Class JmsEventService

  • All Implemented Interfaces:
    EventService

    public class JmsEventService
    extends Object
    implements EventService
    A JMS message producer capable of publishing messages to a JMS broker such as ActiveMQ.
    • Field Detail

      • CONFIG_JMS_QUEUE_NAME

        public static final String CONFIG_JMS_QUEUE_NAME
        The configuration key controlling the JMS queue name.
        See Also:
        Constant Field Values
      • CONFIG_JMS_URL

        public static final String CONFIG_JMS_URL
        The configuration key controlling the JMS broker URL.
        See Also:
        Constant Field Values
      • CONFIG_JMS_USERNAME

        public static final String CONFIG_JMS_USERNAME
        The configuration key controlling the JMS username.
        See Also:
        Constant Field Values
      • CONFIG_JMS_PASSWORD

        public static final String CONFIG_JMS_PASSWORD
        The configuration key controlling the JMS password.
        See Also:
        Constant Field Values
      • CONFIG_JMS_USE_QUEUE

        public static final String CONFIG_JMS_USE_QUEUE
        The configuration key controlling whether to use a topic or queue.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JmsEventService

        public JmsEventService()
        Create a new JMS 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.
      • JmsEventService

        public JmsEventService​(EventSerializationService serializer,
                               Session session,
                               String queueName)
                        throws JMSException
        Create a new JMS Publisher.
        Parameters:
        serializer - the event serializer
        session - the JMS session
        queueName - the name of the queue
        Throws:
        JMSException - when there is a connection error
      • JmsEventService

        public JmsEventService​(EventSerializationService serializer,
                               Session session,
                               String queueName,
                               boolean useQueue)
                        throws JMSException
        Create a new JMS Publisher.
        Parameters:
        serializer - the event serializer
        session - the JMS session
        queueName - the name of the queue
        useQueue - whether to use a queue or a topic
        Throws:
        JMSException - when there is a connection error
    • 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