Interface MessageQueueReceiverEndpoint
-
- All Superinterfaces:
MessageEndpoint,MessageReceiverEndpoint
- All Known Implementing Classes:
DelegateMessageQueueReceiverEndpoint
public interface MessageQueueReceiverEndpoint extends MessageReceiverEndpoint
Receiver-sideMessageEndpoint endpointof a Message Channel with Queue or FIFO semantics.
MessageQueueReceiverEndpointsare Message Endpoints for Point-to-Point Channels:
- See Also:
- EIP: Message Endpoint, EIP: Point-to-Point Channel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Void>consume()Takes zero or more messages from the channel, callsMessageEndpoint.intercept(TextMessage)for every message, and notifies the registered consumers with the intercepted message, or drops the message, ifinterceptreturns null.voidstop()Stops consumption of messages and shuts down theMessageQueueReceiverEndpoint.-
Methods inherited from interface de.otto.synapse.endpoint.MessageEndpoint
getChannelName, getEndpointType, getInterceptorChain, intercept
-
Methods inherited from interface de.otto.synapse.endpoint.receiver.MessageReceiverEndpoint
getMessageDispatcher, register
-
-
-
-
Method Detail
-
consume
java.util.concurrent.CompletableFuture<java.lang.Void> consume()
Takes zero or more messages from the channel, callsMessageEndpoint.intercept(TextMessage)for every message, and notifies the registered consumers with the intercepted message, or drops the message, ifinterceptreturns null.Consumption starts with the earliest available and not-yet-consumed message and finishes when either the
stopConditionis met, or the application is shutting down.The
registeredconsumersare used as a callback for consumed messages. AMessageDispatchercan be used as a consumer, if multiple consumers, or consumers withmessage payloadsother thanStringare required.- Returns:
- completable future that can be used to
waituntil the endpoint has stopped message consumption.
-
stop
void stop()
Stops consumption of messages and shuts down theMessageQueueReceiverEndpoint.
-
-