Interface MessageQueueReceiverEndpoint

All Superinterfaces:
MessageEndpoint, MessageReceiverEndpoint
All Known Implementing Classes:
DelegateMessageQueueReceiverEndpoint

public interface MessageQueueReceiverEndpoint
extends MessageReceiverEndpoint
Receiver-side MessageEndpoint endpoint of a Message Channel with Queue or FIFO semantics.

Message Endpoint

MessageQueueReceiverEndpoints are Message Endpoints for Point-to-Point Channels:

Point-to-Point Channel

See Also:
EIP: Message Endpoint, EIP: Point-to-Point Channel
  • Method Details

    • consume

      java.util.concurrent.CompletableFuture<java.lang.Void> consume()
      Takes zero or more messages from the channel, calls MessageEndpoint.intercept(TextMessage) for every message, and notifies the registered consumers with the intercepted message, or drops the message, if intercept returns null.

      Consumption starts with the earliest available and not-yet-consumed message and finishes when either the stopCondition is met, or the application is shutting down.

      The registered consumers are used as a callback for consumed messages. A MessageDispatcher can be used as a consumer, if multiple consumers, or consumers with message payloads other than String are required.

      Returns:
      completable future that can be used to wait until the endpoint has stopped message consumption.
    • stop

      void stop()
      Stops consumption of messages and shuts down the MessageQueueReceiverEndpoint.