Class ActiveMQMessageSender

  • All Implemented Interfaces:
    java.lang.Runnable, MessageSender

    public class ActiveMQMessageSender
    extends BaseMessageSender
    Initializes JMS session and creates JMS MessageProducer to be used for sending messages to a given destination. It extends BaseMessageSender which starts the worker thread and is tasked with sending messages. The application threads share a common 'queue' with the worker thread. The application threads add messages to the pendingMessageList 'queue' and the worker thread consumes them.
    • Constructor Detail

      • ActiveMQMessageSender

        public ActiveMQMessageSender​(javax.jms.Connection aConnection,
                                     java.lang.String aDestinationName,
                                     BaseUIMAAsynchronousEngineCommon_impl engine)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • initializeProducer

        protected void initializeProducer()
                                   throws java.lang.Exception
        Creates a jms session object used to instantiate message producer
        Specified by:
        initializeProducer in class BaseMessageSender
        Throws:
        java.lang.Exception
      • getDestinationEndpoint

        protected java.lang.String getDestinationEndpoint()
                                                   throws java.lang.Exception
        Returns the full name of the destination queue
        Specified by:
        getDestinationEndpoint in class BaseMessageSender
        Throws:
        java.lang.Exception
      • createTextMessage

        public javax.jms.TextMessage createTextMessage()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createBytesMessage

        public javax.jms.BytesMessage createBytesMessage()
                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • cleanup

        protected void cleanup()
        Cleanup any jms resources used by the worker thread
        Specified by:
        cleanup in class BaseMessageSender