public class RabbitMQReceiver extends RabbitMQBase implements Receiver
Receiver to use a RabbitMQ message broker. Following platform properties are
needed (default value in brackets):
rabbitMQAdresses (localhost:5672): A comma separated list of <host>:<port> for RabbitMQ
server(s)rabbitMQUser (guest): UsernamerabbitMQPassword (guest): PasswordrabbitMQExchange (appng-messaging): Name of the exchange where the receiver binds its messaging queue on.
Be aware that this name must be different among different clusters using the same RabbitMQ serverrabbitMQAutoDeleteQueue (true): If the queue to create should be marked as autodelete.rabbitMQDurableQueue (false): If the queue to create should be marked as durable.rabbitMQExclusiveQueue (true): If the queue to create should be marked as exclusive.addresses, channel, connection, eventSerializer, exchange, factory, password, RABBIT_MQ_ADRESSES, RABBIT_MQ_EXCHANGE, RABBIT_MQ_PASSWORD, RABBIT_MQ_USER, user| Constructor and Description |
|---|
RabbitMQReceiver() |
| Modifier and Type | Method and Description |
|---|---|
Receiver |
configure(Serializer eventSerializer)
Configures the receiver
|
RabbitMQSender |
createSender()
|
void |
registerHandler(EventHandler<?> handler)
Registers a new
EventHandler |
void |
runWith(ExecutorService executorService)
Since a receiver runs as a thread, the given
ExecutorService should be used to run this thread. |
void |
setDefaultHandler(EventHandler<?> defaultHandler)
Sets the default
EventHandler, used when no other handler is registered for a certain event type |
close, initializepublic Receiver configure(Serializer eventSerializer)
Receiverconfigure in interface ReceivereventSerializer - the Serializer for this receiverpublic RabbitMQSender createSender()
ReceiverSender capable of sending Events that can be received by this type of
receiver.createSender in interface ReceiverSenderpublic void runWith(ExecutorService executorService)
ReceiverExecutorService should be used to run this thread.runWith in interface ReceiverexecutorService - the ExecutorService to run this receiver withpublic void registerHandler(EventHandler<?> handler)
ReceiverEventHandlerregisterHandler in interface Receiverhandler - the EventHandler to registerpublic void setDefaultHandler(EventHandler<?> defaultHandler)
ReceiverEventHandler, used when no other handler is registered for a certain event typesetDefaultHandler in interface ReceiverdefaultHandler - the default EventHandler to useCopyright © 2011–2021 aiticon GmbH. All rights reserved.