Package org.trellisldp.amqp
Class AmqpEventService
- java.lang.Object
-
- org.trellisldp.amqp.AmqpEventService
-
- All Implemented Interfaces:
EventService
public class AmqpEventService extends Object implements EventService
An AMQP message producer capable of publishing messages to an AMQP broker such as RabbitMQ or Qpid.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIG_AMQP_EXCHANGE_NAMEThe configuration key controlling the AMQP exchange name.static StringCONFIG_AMQP_IMMEDIATEThe configuration key controlling whether publishing is immediate.static StringCONFIG_AMQP_MANDATORYThe configuration key controlling whether publishing is mandatory.static StringCONFIG_AMQP_ROUTING_KEYThe configuration key controlling the AMQP routing key.static StringCONFIG_AMQP_URIThe configuration key controlling the AMQP connection URI.
-
Constructor Summary
Constructors Constructor Description AmqpEventService()Create an AMQP publisher.AmqpEventService(EventSerializationService serializer, com.rabbitmq.client.Channel channel)Create an AMQP publisher.AmqpEventService(EventSerializationService serializer, com.rabbitmq.client.Channel channel, String exchangeName, String routingKey)Create an AMQP publisher.AmqpEventService(EventSerializationService serializer, com.rabbitmq.client.Channel channel, String exchangeName, String routingKey, boolean mandatory, boolean immediate)Create an AMQP publisher.
-
-
-
Field Detail
-
CONFIG_AMQP_EXCHANGE_NAME
public static final String CONFIG_AMQP_EXCHANGE_NAME
The configuration key controlling the AMQP exchange name.- See Also:
- Constant Field Values
-
CONFIG_AMQP_ROUTING_KEY
public static final String CONFIG_AMQP_ROUTING_KEY
The configuration key controlling the AMQP routing key.- See Also:
- Constant Field Values
-
CONFIG_AMQP_MANDATORY
public static final String CONFIG_AMQP_MANDATORY
The configuration key controlling whether publishing is mandatory.- See Also:
- Constant Field Values
-
CONFIG_AMQP_IMMEDIATE
public static final String CONFIG_AMQP_IMMEDIATE
The configuration key controlling whether publishing is immediate.- See Also:
- Constant Field Values
-
CONFIG_AMQP_URI
public static final String CONFIG_AMQP_URI
The configuration key controlling the AMQP connection URI.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AmqpEventService
public AmqpEventService()
Create an AMQP publisher.- API Note:
- This construtor is used by CDI runtimes that require a public, no-argument constructor. It should not be invoked directly in user code.
-
AmqpEventService
@Inject public AmqpEventService(EventSerializationService serializer, com.rabbitmq.client.Channel channel)
Create an AMQP publisher.- Parameters:
serializer- the event serializerchannel- the channel
-
AmqpEventService
public AmqpEventService(EventSerializationService serializer, com.rabbitmq.client.Channel channel, String exchangeName, String routingKey)
Create an AMQP publisher.- Parameters:
serializer- the event serializerchannel- the channelexchangeName- the exchange nameroutingKey- the routing key
-
AmqpEventService
public AmqpEventService(EventSerializationService serializer, com.rabbitmq.client.Channel channel, String exchangeName, String routingKey, boolean mandatory, boolean immediate)
Create an AMQP publisher.- Parameters:
serializer- the event serializerchannel- the channelexchangeName- the exchange nameroutingKey- the routing keymandatory- the mandatory settingimmediate- the immediate setting
-
-
Method Detail
-
emit
public void emit(Event event)
Description copied from interface:EventServiceEmit an event to the event service.- Specified by:
emitin interfaceEventService- Parameters:
event- the event
-
-