Package org.apache.camel.component.sjms
Class SjmsComponent
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultComponent
-
- org.apache.camel.support.HeaderFilterStrategyComponent
-
- org.apache.camel.component.sjms.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 Summary
Constructors Modifier Constructor Description SjmsComponent()
protected
SjmsComponent(Class<? extends org.apache.camel.Endpoint> endpointClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.camel.Endpoint
createEndpoint(String uri, String remaining, Map<String,Object> parameters)
protected SjmsEndpoint
createSjmsEndpoint(String uri, String remaining)
protected void
doShutdown()
protected void
doStart()
protected void
doStop()
protected ExecutorService
getAsyncStartStopExecutorService()
String
getConnectionClientId()
Integer
getConnectionCount()
javax.jms.ConnectionFactory
getConnectionFactory()
long
getConnectionMaxWait()
String
getConnectionPassword()
ConnectionResource
getConnectionResource()
String
getConnectionUsername()
DestinationCreationStrategy
getDestinationCreationStrategy()
JmsKeyFormatStrategy
getJmsKeyFormatStrategy()
MessageCreatedStrategy
getMessageCreatedStrategy()
long
getReconnectBackOff()
TimedTaskManager
getTimedTaskManager()
TransactionCommitStrategy
getTransactionCommitStrategy()
boolean
isConnectionTestOnBorrow()
boolean
isReconnectOnError()
void
setConnectionClientId(String connectionClientId)
The client ID to use when creatingConnection
when using the defaultConnectionFactoryResource
.void
setConnectionCount(Integer maxConnections)
The maximum number of connections available to endpoints started under this componentvoid
setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
A ConnectionFactory is required to enable the SjmsComponent.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 defaultConnectionFactoryResource
.void
setConnectionPassword(String connectionPassword)
The password to use when creatingConnection
when using the defaultConnectionFactoryResource
.void
setConnectionResource(ConnectionResource connectionResource)
A ConnectionResource is an interface that allows for customization and container control of the ConnectionFactory.void
setConnectionTestOnBorrow(boolean connectionTestOnBorrow)
When using the defaultConnectionFactoryResource
then should eachConnection
be tested (calling start) before returned from the pool.void
setConnectionUsername(String connectionUsername)
The username to use when creatingConnection
when using the defaultConnectionFactoryResource
.void
setDestinationCreationStrategy(DestinationCreationStrategy destinationCreationStrategy)
To use a custom DestinationCreationStrategy.void
setJmsKeyFormatStrategy(JmsKeyFormatStrategy jmsKeyFormatStrategy)
Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification.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.void
setReconnectBackOff(long reconnectBackOff)
Backoff in millis on consumer pool reconnection attemptsvoid
setReconnectOnError(boolean reconnectOnError)
Try to apply reconnection logic on consumer poolvoid
setTimedTaskManager(TimedTaskManager timedTaskManager)
To use a custom TimedTaskManagervoid
setTransactionCommitStrategy(TransactionCommitStrategy commitStrategy)
To configure which kind of commit strategy to use.-
Methods inherited from class org.apache.camel.support.HeaderFilterStrategyComponent
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy
-
Methods inherited from class org.apache.camel.support.DefaultComponent
afterConfiguration, createEndpoint, createEndpoint, doBuild, doInit, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
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 classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
createSjmsEndpoint
protected SjmsEndpoint createSjmsEndpoint(String uri, String remaining)
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
doShutdown
protected void doShutdown() throws Exception
- Overrides:
doShutdown
in classorg.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.
-
getConnectionResource
public ConnectionResource getConnectionResource()
-
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.
-
getJmsKeyFormatStrategy
public JmsKeyFormatStrategy getJmsKeyFormatStrategy()
-
getTransactionCommitStrategy
public TransactionCommitStrategy getTransactionCommitStrategy()
-
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.
-
getDestinationCreationStrategy
public DestinationCreationStrategy getDestinationCreationStrategy()
-
setDestinationCreationStrategy
public void setDestinationCreationStrategy(DestinationCreationStrategy destinationCreationStrategy)
To use a custom DestinationCreationStrategy.
-
getTimedTaskManager
public TimedTaskManager getTimedTaskManager()
-
setTimedTaskManager
public void setTimedTaskManager(TimedTaskManager timedTaskManager)
To use a custom TimedTaskManager
-
getMessageCreatedStrategy
public MessageCreatedStrategy getMessageCreatedStrategy()
-
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 defaultConnectionFactoryResource
then should eachConnection
be tested (calling start) before returned from the pool.
-
getConnectionUsername
public String getConnectionUsername()
-
setConnectionUsername
public void setConnectionUsername(String connectionUsername)
The username to use when creatingConnection
when using the defaultConnectionFactoryResource
.
-
getConnectionPassword
public String getConnectionPassword()
-
setConnectionPassword
public void setConnectionPassword(String connectionPassword)
The password to use when creatingConnection
when using the defaultConnectionFactoryResource
.
-
getConnectionClientId
public String getConnectionClientId()
-
setConnectionClientId
public void setConnectionClientId(String connectionClientId)
The client ID to use when creatingConnection
when using the defaultConnectionFactoryResource
.
-
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 defaultConnectionFactoryResource
.
-
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
-
-