Class SjmsComponent

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Component, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HeaderFilterStrategyAware, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @Component("sjms")
    public class SjmsComponent
    extends org.apache.camel.support.HeaderFilterStrategyComponent
    The Simple JMS component.
    • Constructor Detail

      • SjmsComponent

        public SjmsComponent()
      • SjmsComponent

        protected SjmsComponent​(Class<? extends org.apache.camel.Endpoint> endpointClass)
    • Method Detail

      • createEndpoint

        protected org.apache.camel.Endpoint createEndpoint​(String uri,
                                                           String remaining,
                                                           Map<String,​Object> parameters)
                                                    throws Exception
        Specified by:
        createEndpoint in class org.apache.camel.support.DefaultComponent
        Throws:
        Exception
      • doStart

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

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

        protected void doShutdown()
                           throws Exception
        Overrides:
        doShutdown in class org.apache.camel.support.service.BaseService
        Throws:
        Exception
      • getAsyncStartStopExecutorService

        protected ExecutorService getAsyncStartStopExecutorService()
      • setConnectionFactory

        public void setConnectionFactory​(javax.jms.ConnectionFactory connectionFactory)
        A ConnectionFactory is required to enable the SjmsComponent. It can be set directly or set set as part of a ConnectionResource.
      • getConnectionFactory

        public javax.jms.ConnectionFactory getConnectionFactory()
      • setConnectionResource

        public void setConnectionResource​(ConnectionResource connectionResource)
        A ConnectionResource is an interface that allows for customization and container control of the ConnectionFactory. See Plugable Connection Resource Management for further details.
      • setConnectionCount

        public void setConnectionCount​(Integer maxConnections)
        The maximum number of connections available to endpoints started under this component
      • getConnectionCount

        public Integer getConnectionCount()
      • setJmsKeyFormatStrategy

        public void setJmsKeyFormatStrategy​(JmsKeyFormatStrategy jmsKeyFormatStrategy)
        Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides one implementation out of the box: default. The default strategy will safely marshal dots and hyphens (. and -). Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the # notation.
      • setTransactionCommitStrategy

        public void setTransactionCommitStrategy​(TransactionCommitStrategy commitStrategy)
        To configure which kind of commit strategy to use. Camel provides two implementations out of the box, default and batch.
      • setDestinationCreationStrategy

        public void setDestinationCreationStrategy​(DestinationCreationStrategy destinationCreationStrategy)
        To use a custom DestinationCreationStrategy.
      • setTimedTaskManager

        public void setTimedTaskManager​(TimedTaskManager timedTaskManager)
        To use a custom TimedTaskManager
      • setMessageCreatedStrategy

        public void setMessageCreatedStrategy​(MessageCreatedStrategy messageCreatedStrategy)
        To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of javax.jms.Message objects when Camel is sending a JMS message.
      • isConnectionTestOnBorrow

        public boolean isConnectionTestOnBorrow()
      • setConnectionTestOnBorrow

        public void setConnectionTestOnBorrow​(boolean connectionTestOnBorrow)
        When using the default ConnectionFactoryResource then should each Connection be tested (calling start) before returned from the pool.
      • getConnectionUsername

        public String getConnectionUsername()
      • setConnectionUsername

        public void setConnectionUsername​(String connectionUsername)
        The username to use when creating Connection when using the default ConnectionFactoryResource.
      • getConnectionPassword

        public String getConnectionPassword()
      • setConnectionPassword

        public void setConnectionPassword​(String connectionPassword)
        The password to use when creating Connection when using the default ConnectionFactoryResource.
      • getConnectionClientId

        public String getConnectionClientId()
      • setConnectionClientId

        public void setConnectionClientId​(String connectionClientId)
        The client ID to use when creating Connection when using the default ConnectionFactoryResource.
      • getConnectionMaxWait

        public long getConnectionMaxWait()
      • setConnectionMaxWait

        public void setConnectionMaxWait​(long connectionMaxWait)
        The max wait time in millis to block and wait on free connection when the pool is exhausted when using the default ConnectionFactoryResource.
      • isReconnectOnError

        public boolean isReconnectOnError()
      • setReconnectOnError

        public void setReconnectOnError​(boolean reconnectOnError)
        Try to apply reconnection logic on consumer pool
      • getReconnectBackOff

        public long getReconnectBackOff()
      • setReconnectBackOff

        public void setReconnectBackOff​(long reconnectBackOff)
        Backoff in millis on consumer pool reconnection attempts