Class 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 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 serializer
        channel - the channel
      • AmqpEventService

        public AmqpEventService​(EventSerializationService serializer,
                                com.rabbitmq.client.Channel channel,
                                String exchangeName,
                                String routingKey)
        Create an AMQP publisher.
        Parameters:
        serializer - the event serializer
        channel - the channel
        exchangeName - the exchange name
        routingKey - 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 serializer
        channel - the channel
        exchangeName - the exchange name
        routingKey - the routing key
        mandatory - the mandatory setting
        immediate - the immediate setting
    • Method Detail

      • emit

        public void emit​(Event event)
        Description copied from interface: EventService
        Emit an event to the event service.
        Specified by:
        emit in interface EventService
        Parameters:
        event - the event