public class JmsComponent extends UriEndpointComponent implements org.springframework.context.ApplicationContextAware, HeaderFilterStrategyAware
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
JmsComponent() |
JmsComponent(CamelContext context) |
JmsComponent(CamelContext context,
Class<? extends Endpoint> endpointClass) |
JmsComponent(Class<? extends Endpoint> endpointClass) |
JmsComponent(JmsConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
protected String |
convertPathToActualDestination(String path,
Map<String,Object> parameters)
A strategy method allowing the URI destination to be translated into the
actual JMS destination name (say by looking up in JNDI or something)
|
protected JmsConfiguration |
createConfiguration()
Factory method to create the default configuration instance
|
protected Endpoint |
createEndpoint(String uri,
String remaining,
Map<String,Object> parameters)
A factory method allowing derived components to create a new endpoint
from the given URI, remaining path and optional parameters
|
protected JmsEndpoint |
createQueueEndpoint(String uri,
JmsComponent component,
String subject,
JmsConfiguration configuration,
QueueBrowseStrategy queueBrowseStrategy) |
protected JmsEndpoint |
createTemporaryQueueEndpoint(String uri,
JmsComponent component,
String subject,
JmsConfiguration configuration,
QueueBrowseStrategy queueBrowseStrategy) |
protected JmsEndpoint |
createTemporaryTopicEndpoint(String uri,
JmsComponent component,
String subject,
JmsConfiguration configuration) |
protected JmsEndpoint |
createTopicEndpoint(String uri,
JmsComponent component,
String subject,
JmsConfiguration configuration) |
protected void |
doShutdown()
Implementations override this method to perform customized shutdown.
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected ExecutorService |
getAsyncStartStopExecutorService() |
JmsConfiguration |
getConfiguration() |
HeaderFilterStrategy |
getHeaderFilterStrategy()
Gets the header filter strategy used
|
MessageCreatedStrategy |
getMessageCreatedStrategy() |
QueueBrowseStrategy |
getQueueBrowseStrategy() |
static JmsComponent |
jmsComponent()
Static builder method
|
static JmsComponent |
jmsComponent(javax.jms.ConnectionFactory connectionFactory)
Static builder method
|
static JmsComponent |
jmsComponent(JmsConfiguration configuration)
Static builder method
|
static JmsComponent |
jmsComponentAutoAcknowledge(javax.jms.ConnectionFactory connectionFactory)
Static builder method
|
static JmsComponent |
jmsComponentClientAcknowledge(javax.jms.ConnectionFactory connectionFactory)
Static builder method
|
static JmsComponent |
jmsComponentTransacted(javax.jms.ConnectionFactory connectionFactory) |
static JmsComponent |
jmsComponentTransacted(javax.jms.ConnectionFactory connectionFactory,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
void |
setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
Specifies whether the consumer accept messages while it is stopping.
|
void |
setAcknowledgementMode(int consumerAcknowledgementMode)
The JMS acknowledgement mode defined as an Integer.
|
void |
setAcknowledgementModeName(String consumerAcknowledgementMode)
The JMS acknowledgement name, which is one of: SESSION_TRANSACTED, CLIENT_ACKNOWLEDGE, AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
|
void |
setAllowNullBody(boolean allowNullBody)
Whether to allow sending messages with no body.
|
void |
setAllowReplyManagerQuickStop(boolean allowReplyManagerQuickStop)
Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow
the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfiguration#isAcceptMessagesWhileStopping
is enabled, and org.apache.camel.CamelContext is currently being stopped.
|
void |
setAlwaysCopyMessage(boolean alwaysCopyMessage)
If true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Sets the Spring ApplicationContext to use
|
void |
setAsyncConsumer(boolean asyncConsumer)
Whether the JmsConsumer processes the Exchange asynchronously.
|
void |
setAsyncStartListener(boolean asyncStartListener)
Whether to startup the JmsConsumer message listener asynchronously, when starting a route.
|
void |
setAsyncStopListener(boolean asyncStopListener)
Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.
|
void |
setAutoStartup(boolean autoStartup)
Specifies whether the consumer container should auto-startup.
|
void |
setCacheLevel(int cacheLevel)
Sets the cache level by ID for the underlying JMS resources.
|
void |
setCacheLevelName(String cacheName)
Sets the cache level by name for the underlying JMS resources.
|
void |
setClientId(String consumerClientId)
Sets the JMS client ID to use.
|
void |
setConcurrentConsumers(int concurrentConsumers)
Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS).
|
void |
setConfiguration(JmsConfiguration configuration)
To use a shared JMS configuration
|
void |
setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
Sets the default connection factory to be use
|
void |
setDefaultTaskExecutorType(DefaultTaskExecutorType type)
Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer,
for both consumer endpoints and the ReplyTo consumer of producer endpoints.
|
void |
setDeliveryMode(Integer deliveryMode)
Specifies the delivery mode to be used.
|
void |
setDeliveryPersistent(boolean deliveryPersistent)
Specifies whether persistent delivery is used by default.
|
void |
setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver destinationResolver)
A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver
(for example, to lookup the real destination in a JNDI registry).
|
void |
setDurableSubscriptionName(String durableSubscriptionName)
The durable subscriber name for specifying durable topic subscriptions.
|
void |
setEagerLoadingOfProperties(boolean eagerLoadingOfProperties)
Enables eager loading of JMS properties as soon as a message is loaded
which generally is inefficient as the JMS properties may not be required
but sometimes can catch early any issues with the underlying JMS provider
and the use of JMS properties
|
void |
setErrorHandler(org.springframework.util.ErrorHandler errorHandler)
Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message.
|
void |
setErrorHandlerLoggingLevel(LoggingLevel errorHandlerLoggingLevel)
Allows to configure the default errorHandler logging level for logging uncaught exceptions.
|
void |
setErrorHandlerLogStackTrace(boolean errorHandlerLogStackTrace)
Allows to control whether stacktraces should be logged or not, by the default errorHandler.
|
void |
setExceptionListener(javax.jms.ExceptionListener exceptionListener)
Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.
|
void |
setExplicitQosEnabled(boolean explicitQosEnabled)
Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages.
|
void |
setExposeListenerSession(boolean exposeListenerSession)
Specifies whether the listener session should be exposed when consuming messages.
|
void |
setForceSendOriginalMessage(boolean forceSendOriginalMessage)
When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination
if you touch the headers (get or set) during the route.
|
void |
setHeaderFilterStrategy(HeaderFilterStrategy strategy)
To use a custom HeaderFilterStrategy to filter header to and from Camel message.
|
void |
setIdleConsumerLimit(int idleConsumerLimit)
Specify the limit for the number of consumers that are allowed to be idle at any given time.
|
void |
setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
Specifies the limit for idle executions of a receive task, not having received any message within its execution.
|
void |
setIncludeAllJMSXProperties(boolean includeAllJMSXProperties)
Whether to include all JMSXxxx properties when mapping from JMS to Camel Message.
|
void |
setIncludeSentJMSMessageID(boolean includeSentJMSMessageID)
Only applicable when sending to JMS destination using InOnly (eg fire and forget).
|
void |
setJmsKeyFormatStrategy(JmsKeyFormatStrategy jmsKeyFormatStrategy)
Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification.
|
void |
setJmsKeyFormatStrategy(String jmsKeyFormatStrategyName)
Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification.
|
void |
setJmsOperations(org.springframework.jms.core.JmsOperations jmsOperations)
Allows you to use your own implementation of the org.springframework.jms.core.JmsOperations interface.
|
void |
setLazyCreateTransactionManager(boolean lazyCreating)
If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true.
|
void |
setMapJmsMessage(boolean mapJmsMessage)
Specifies whether Camel should auto map the received JMS message to a suited payload type, such as javax.jms.TextMessage to a String etc.
|
void |
setMaxConcurrentConsumers(int maxConcurrentConsumers)
Specifies the maximum number of concurrent consumers when consuming from JMS (not for request/reply over JMS).
|
void |
setMaxMessagesPerTask(int maxMessagesPerTask)
The number of messages per task.
|
void |
setMessageConverter(org.springframework.jms.support.converter.MessageConverter messageConverter)
To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control
how to map to/from a javax.jms.Message.
|
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 |
setMessageIdEnabled(boolean messageIdEnabled)
When sending, specifies whether message IDs should be added.
|
void |
setMessageTimestampEnabled(boolean messageTimestampEnabled)
Specifies whether timestamps should be enabled by default on sending messages.
|
void |
setPreserveMessageQos(boolean preserveMessageQos)
Set to true, if you want to send message using the QoS settings specified on the message,
instead of the QoS settings on the JMS endpoint.
|
void |
setPriority(int priority)
Values greater than 1 specify the message priority when sending (where 0 is the lowest priority and 9 is the highest).
|
void |
setPubSubNoLocal(boolean pubSubNoLocal)
Specifies whether to inhibit the delivery of messages published by its own connection.
|
void |
setQueueBrowseStrategy(QueueBrowseStrategy queueBrowseStrategy)
To use a custom QueueBrowseStrategy when browsing queues
|
void |
setReceiveTimeout(long receiveTimeout)
The timeout for receiving messages (in milliseconds).
|
void |
setRecoveryInterval(long recoveryInterval)
Specifies the interval between recovery attempts, i.e.
|
void |
setReplyOnTimeoutToMaxConcurrentConsumers(int maxConcurrentConsumers)
Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.
|
void |
setReplyToCacheLevelName(String cacheName)
Sets the cache level by name for the reply consumer when doing request/reply over JMS.
|
void |
setReplyToConcurrentConsumers(int concurrentConsumers)
Specifies the default number of concurrent consumers when doing request/reply over JMS.
|
void |
setReplyToMaxConcurrentConsumers(int maxConcurrentConsumers)
Specifies the maximum number of concurrent consumers when using request/reply over JMS.
|
void |
setReplyToType(ReplyToType replyToType)
Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS.
|
void |
setRequestTimeout(long requestTimeout)
The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds).
|
void |
setRequestTimeoutCheckerInterval(long requestTimeoutCheckerInterval)
Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS.
|
void |
setSubscriptionDurable(boolean subscriptionDurable)
Deprecated.
|
void |
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Allows you to specify a custom task executor for consuming messages.
|
void |
setTestConnectionOnStartup(boolean testConnectionOnStartup)
Specifies whether to test the connection on startup.
|
void |
setTimeToLive(long timeToLive)
When sending messages, specifies the time-to-live of the message (in milliseconds).
|
void |
setTransacted(boolean consumerTransacted)
Specifies whether to use transacted mode
|
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
The Spring transaction manager to use.
|
void |
setTransactionName(String transactionName)
The name of the transaction to use.
|
void |
setTransactionTimeout(int transactionTimeout)
The timeout value of the transaction (in seconds), if using transacted mode.
|
void |
setTransferException(boolean transferException)
If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side,
then the caused Exception will be send back in response as a javax.jms.ObjectMessage.
|
void |
setTransferExchange(boolean transferExchange)
You can transfer the exchange over the wire instead of just the body and headers.
|
void |
setTransferFault(boolean transferFault)
If enabled and you are using Request Reply messaging (InOut) and an Exchange failed with a SOAP fault (not exception) on the consumer side,
then the fault flag on
Message.isFault() will be send back in the response as a JMS header with the key
JmsConstants.JMS_TRANSFER_FAULT . |
void |
setUseMessageIDAsCorrelationID(boolean useMessageIDAsCorrelationID)
Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.
|
createComponentConfiguration, createParameterConfigurationMap, getEndpointClass, getParameterConfigurationMap, populateParameterConfigurationMap, setEndpointClass
afterConfiguration, createConfiguration, createEndpoint, doStop, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, ifStartsWithReturnRemainder, preProcessUri, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setCamelContext, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public JmsComponent()
public JmsComponent(CamelContext context)
public JmsComponent(CamelContext context, Class<? extends Endpoint> endpointClass)
public JmsComponent(JmsConfiguration configuration)
public static JmsComponent jmsComponent()
public static JmsComponent jmsComponent(JmsConfiguration configuration)
public static JmsComponent jmsComponent(javax.jms.ConnectionFactory connectionFactory)
public static JmsComponent jmsComponentClientAcknowledge(javax.jms.ConnectionFactory connectionFactory)
public static JmsComponent jmsComponentAutoAcknowledge(javax.jms.ConnectionFactory connectionFactory)
public static JmsComponent jmsComponentTransacted(javax.jms.ConnectionFactory connectionFactory)
public static JmsComponent jmsComponentTransacted(javax.jms.ConnectionFactory connectionFactory, org.springframework.transaction.PlatformTransactionManager transactionManager)
public JmsConfiguration getConfiguration()
public void setConfiguration(JmsConfiguration configuration)
public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
public void setAllowReplyManagerQuickStop(boolean allowReplyManagerQuickStop)
public void setAcknowledgementMode(int consumerAcknowledgementMode)
public void setEagerLoadingOfProperties(boolean eagerLoadingOfProperties)
public void setAcknowledgementModeName(String consumerAcknowledgementMode)
public void setAutoStartup(boolean autoStartup)
public void setCacheLevel(int cacheLevel)
public void setCacheLevelName(String cacheName)
public void setReplyToCacheLevelName(String cacheName)
public void setClientId(String consumerClientId)
public void setConcurrentConsumers(int concurrentConsumers)
public void setReplyToConcurrentConsumers(int concurrentConsumers)
public void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)
public void setDeliveryPersistent(boolean deliveryPersistent)
public void setDeliveryMode(Integer deliveryMode)
public void setDurableSubscriptionName(String durableSubscriptionName)
public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
public void setErrorHandler(org.springframework.util.ErrorHandler errorHandler)
public void setErrorHandlerLoggingLevel(LoggingLevel errorHandlerLoggingLevel)
public void setErrorHandlerLogStackTrace(boolean errorHandlerLogStackTrace)
public void setExplicitQosEnabled(boolean explicitQosEnabled)
public void setExposeListenerSession(boolean exposeListenerSession)
public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
public void setIdleConsumerLimit(int idleConsumerLimit)
public void setMaxConcurrentConsumers(int maxConcurrentConsumers)
public void setReplyToMaxConcurrentConsumers(int maxConcurrentConsumers)
public void setReplyOnTimeoutToMaxConcurrentConsumers(int maxConcurrentConsumers)
public void setMaxMessagesPerTask(int maxMessagesPerTask)
public void setMessageConverter(org.springframework.jms.support.converter.MessageConverter messageConverter)
public void setMapJmsMessage(boolean mapJmsMessage)
public void setMessageIdEnabled(boolean messageIdEnabled)
public void setMessageTimestampEnabled(boolean messageTimestampEnabled)
public void setAlwaysCopyMessage(boolean alwaysCopyMessage)
public void setUseMessageIDAsCorrelationID(boolean useMessageIDAsCorrelationID)
public void setPriority(int priority)
public void setPubSubNoLocal(boolean pubSubNoLocal)
public void setReceiveTimeout(long receiveTimeout)
public void setRecoveryInterval(long recoveryInterval)
@Deprecated public void setSubscriptionDurable(boolean subscriptionDurable)
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
public void setTimeToLive(long timeToLive)
public void setTransacted(boolean consumerTransacted)
public void setLazyCreateTransactionManager(boolean lazyCreating)
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
public void setTransactionName(String transactionName)
public void setTransactionTimeout(int transactionTimeout)
public void setTestConnectionOnStartup(boolean testConnectionOnStartup)
public void setAsyncStartListener(boolean asyncStartListener)
public void setAsyncStopListener(boolean asyncStopListener)
public void setForceSendOriginalMessage(boolean forceSendOriginalMessage)
public void setRequestTimeout(long requestTimeout)
public void setRequestTimeoutCheckerInterval(long requestTimeoutCheckerInterval)
public void setTransferExchange(boolean transferExchange)
public void setTransferException(boolean transferException)
public void setTransferFault(boolean transferFault)
Message.isFault()
will be send back in the response as a JMS header with the key
JmsConstants.JMS_TRANSFER_FAULT
.
If the client is Camel, the returned fault flag will be set on the Message.setFault(boolean)
.
You may want to enable this when using Camel components that support faults such as SOAP based such as cxf or spring-ws.public void setJmsOperations(org.springframework.jms.core.JmsOperations jmsOperations)
public void setDestinationResolver(org.springframework.jms.support.destination.DestinationResolver destinationResolver)
public void setReplyToType(ReplyToType replyToType)
public void setPreserveMessageQos(boolean preserveMessageQos)
public void setAsyncConsumer(boolean asyncConsumer)
public void setAllowNullBody(boolean allowNullBody)
public void setIncludeSentJMSMessageID(boolean includeSentJMSMessageID)
public void setIncludeAllJMSXProperties(boolean includeAllJMSXProperties)
public void setDefaultTaskExecutorType(DefaultTaskExecutorType type)
public void setJmsKeyFormatStrategy(JmsKeyFormatStrategy jmsKeyFormatStrategy)
public void setJmsKeyFormatStrategy(String jmsKeyFormatStrategyName)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public QueueBrowseStrategy getQueueBrowseStrategy()
public void setQueueBrowseStrategy(QueueBrowseStrategy queueBrowseStrategy)
public HeaderFilterStrategy getHeaderFilterStrategy()
HeaderFilterStrategyAware
getHeaderFilterStrategy
in interface HeaderFilterStrategyAware
public void setHeaderFilterStrategy(HeaderFilterStrategy strategy)
setHeaderFilterStrategy
in interface HeaderFilterStrategyAware
strategy
- the strategypublic MessageCreatedStrategy getMessageCreatedStrategy()
public void setMessageCreatedStrategy(MessageCreatedStrategy messageCreatedStrategy)
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class DefaultComponent
Exception
ServiceSupport.doStop()
protected void doShutdown() throws Exception
ServiceSupport
doShutdown
in class ServiceSupport
Exception
protected ExecutorService getAsyncStartStopExecutorService()
protected Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
DefaultComponent
createEndpoint
in class DefaultComponent
uri
- the full URI of the endpointremaining
- the remaining part of the URI without the query
parameters or component prefixparameters
- the optional parameters passed inException
- is thrown if error creating the endpointprotected JmsEndpoint createTemporaryTopicEndpoint(String uri, JmsComponent component, String subject, JmsConfiguration configuration)
protected JmsEndpoint createTopicEndpoint(String uri, JmsComponent component, String subject, JmsConfiguration configuration)
protected JmsEndpoint createTemporaryQueueEndpoint(String uri, JmsComponent component, String subject, JmsConfiguration configuration, QueueBrowseStrategy queueBrowseStrategy)
protected JmsEndpoint createQueueEndpoint(String uri, JmsComponent component, String subject, JmsConfiguration configuration, QueueBrowseStrategy queueBrowseStrategy)
protected String convertPathToActualDestination(String path, Map<String,Object> parameters)
protected JmsConfiguration createConfiguration()
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.