Interface EmgReceiver

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
ServiceBusEmgReceiver

public interface EmgReceiver extends AutoCloseable
A peek-lock receiver bound to one EMG queue (or topic subscription). This is the seam between EmgListener and a concrete messaging client; the bundled implementation is ServiceBusEmgReceiver.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the underlying connection.
    receive(int maxMessages, Duration maxWait)
    Receives up to maxMessages, waiting at most maxWait for the first one.
  • Method Details

    • receive

      List<EmgDelivery> receive(int maxMessages, Duration maxWait)
      Receives up to maxMessages, waiting at most maxWait for the first one.
      Parameters:
      maxMessages - upper bound on the batch size, at least 1
      maxWait - how long to wait before returning a possibly empty batch
      Returns:
      the locked deliveries, possibly empty, never null
    • close

      void close()
      Closes the underlying connection. Unsettled locks are released by the broker.
      Specified by:
      close in interface AutoCloseable