Class SjmsConsumer

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.Consumer, org.apache.camel.EndpointAware, org.apache.camel.RouteAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.RouteIdAware, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    public class SjmsConsumer
    extends org.apache.camel.support.DefaultConsumer
    The SjmsConsumer is the base class for the SJMS MessageListener pool.
    • Field Summary

      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILDED, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTINGDOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Constructor Summary

      Constructors 
      Constructor Description
      SjmsConsumer​(org.apache.camel.Endpoint endpoint, org.apache.camel.Processor processor)  
    • Constructor Detail

      • SjmsConsumer

        public SjmsConsumer​(org.apache.camel.Endpoint endpoint,
                            org.apache.camel.Processor processor)
    • Method Detail

      • getEndpoint

        public SjmsEndpoint getEndpoint()
        Specified by:
        getEndpoint in interface org.apache.camel.EndpointAware
        Overrides:
        getEndpoint in class org.apache.camel.support.DefaultConsumer
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.apache.camel.support.DefaultConsumer
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.support.DefaultConsumer
        Throws:
        Exception
      • createMessageHandler

        protected javax.jms.MessageListener createMessageHandler​(javax.jms.Session session)
        Helper factory method used to create a MessageListener based on the MEP
        Parameters:
        session - a session is only required if we are a transacted consumer
        Returns:
        the listener
      • getOrCreateConnectionResource

        protected ConnectionResource getOrCreateConnectionResource()
      • getAcknowledgementMode

        public int getAcknowledgementMode()
      • isTransacted

        public boolean isTransacted()
        Use to determine if transactions are enabled or disabled.
        Returns:
        true if transacted, otherwise false
      • isSharedJMSSession

        public boolean isSharedJMSSession()
        Use to determine if JMS session should be propagated to share with other SJMS endpoints.
        Returns:
        true if shared, otherwise false
      • isSynchronous

        public boolean isSynchronous()
        Use to determine whether or not to process exchanges synchronously.
        Returns:
        true if synchronous
      • getDestinationName

        public String getDestinationName()
        The destination name for this consumer.
        Returns:
        String
      • getConsumerCount

        public int getConsumerCount()
        Returns the number of consumer listeners.
        Returns:
        the consumerCount
      • isTopic

        public boolean isTopic()
        Flag set by the endpoint used by consumers and producers to determine if the consumer is a JMS Topic.
        Returns:
        the topic true if consumer is a JMS Topic, default is false
      • getMessageSelector

        public String getMessageSelector()
        Gets the JMS Message selector syntax.
      • getDurableSubscriptionId

        public String getDurableSubscriptionId()
        Gets the durable subscription Id.
        Returns:
        the durableSubscriptionId
      • getTransactionCommitStrategy

        public TransactionCommitStrategy getTransactionCommitStrategy()
        Gets the commit strategy.
        Returns:
        the transactionCommitStrategy
      • getTransactionBatchCount

        public int getTransactionBatchCount()
        If transacted, returns the nubmer of messages to be processed before committing the transaction.
        Returns:
        the transactionBatchCount
      • getTransactionBatchTimeout

        public long getTransactionBatchTimeout()
        Returns the timeout value for batch transactions.
        Returns:
        long