Class JMSRequestProxy

java.lang.Object
no.mnemonic.messaging.requestsink.jms.AbstractJMSRequestBase
no.mnemonic.messaging.requestsink.jms.JMSRequestProxy
All Implemented Interfaces:
javax.jms.ExceptionListener, no.mnemonic.commons.component.LifecycleAspect, no.mnemonic.commons.metrics.MetricAspect, no.mnemonic.commons.utilities.AppendMembers

public class JMSRequestProxy extends AbstractJMSRequestBase implements no.mnemonic.commons.metrics.MetricAspect
A JMSRequestProxy is the listener component handling messages sent from a JMSRequestSink, dispatching them to the configured RequestSink.

The JMSRequestProxy listens to messages on a JMS queue or topic, and will unpack the message, signal the downstream RequestSink, and handle any replies.

Each request will be run in a separate thread, and the maxConcurrentCalls parameter puts a limit on the maximum requests being handled. If more messages are sent to the JMS queue, these will not be consumed by the JMS Request Sink until a thread is available. This allows multiple JMSRequestProxies to share the load from a queue, and acts as a resource limitation.

  • Method Details

    • getMetrics

      public no.mnemonic.commons.metrics.Metrics getMetrics() throws no.mnemonic.commons.metrics.MetricException
      Specified by:
      getMetrics in interface no.mnemonic.commons.metrics.MetricAspect
      Throws:
      no.mnemonic.commons.metrics.MetricException
    • startComponent

      public void startComponent()
      Specified by:
      startComponent in interface no.mnemonic.commons.component.LifecycleAspect
    • stopComponent

      public void stopComponent()
      Specified by:
      stopComponent in interface no.mnemonic.commons.component.LifecycleAspect
    • onException

      public void onException(javax.jms.JMSException e)
      Specified by:
      onException in interface javax.jms.ExceptionListener
    • addJMSRequestProxyConnectionListener

      public void addJMSRequestProxyConnectionListener(JMSRequestProxy.JMSRequestProxyConnectionListener listener)
    • builder

      public static JMSRequestProxy.Builder builder()