public class AmqpPublisher extends Object implements EventService
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_AMQP_EXCHANGE_NAME
The configuration key controlling the AMQP exchange name.
|
static String |
CONFIG_AMQP_IMMEDIATE
The configuration key controlling whether publishing is immediate.
|
static String |
CONFIG_AMQP_MANDATORY
The configuration key controlling whether publishing is mandatory.
|
static String |
CONFIG_AMQP_ROUTING_KEY
The configuration key controlling the AMQP routing key.
|
static String |
CONFIG_AMQP_URI
The configuration key controlling the AMQP connection URI.
|
| Constructor and Description |
|---|
AmqpPublisher()
Create an AMQP publisher.
|
AmqpPublisher(com.rabbitmq.client.Channel channel)
Create an AMQP publisher.
|
AmqpPublisher(com.rabbitmq.client.Channel channel,
String exchangeName,
String routingKey)
Create an AMQP publisher.
|
AmqpPublisher(com.rabbitmq.client.Channel channel,
String exchangeName,
String routingKey,
boolean mandatory,
boolean immediate)
Create an AMQP publisher.
|
public static final String CONFIG_AMQP_EXCHANGE_NAME
public static final String CONFIG_AMQP_ROUTING_KEY
public static final String CONFIG_AMQP_MANDATORY
public static final String CONFIG_AMQP_IMMEDIATE
public static final String CONFIG_AMQP_URI
@Inject public AmqpPublisher() throws IOException, GeneralSecurityException, URISyntaxException, TimeoutException
IOException - in the event that an I/O related error occurs when connectingGeneralSecurityException - in the event that a security error occurs when connectingURISyntaxException - in the event that the connection URI is syntactically incorrectTimeoutException - in the event that the connection times outpublic AmqpPublisher(com.rabbitmq.client.Channel channel)
channel - the channelpublic AmqpPublisher(com.rabbitmq.client.Channel channel,
String exchangeName,
String routingKey)
channel - the channelexchangeName - the exchange nameroutingKey - the routing keypublic AmqpPublisher(com.rabbitmq.client.Channel channel,
String exchangeName,
String routingKey,
boolean mandatory,
boolean immediate)
channel - the channelexchangeName - the exchange nameroutingKey - the routing keymandatory - the mandatory settingimmediate - the immediate settingpublic void emit(Event event)
EventServiceemit in interface EventServiceevent - the event