org.apache.camel.component.jms
Class JmsConfiguration

java.lang.Object
  extended by org.apache.camel.component.jms.JmsConfiguration
All Implemented Interfaces:
Cloneable

public class JmsConfiguration
extends Object
implements Cloneable

Version:
$Revision: 21895 $

Nested Class Summary
static class JmsConfiguration.CamelJmsTemplate
           
 
Field Summary
static String QUEUE_PREFIX
           
static String TEMP_QUEUE_PREFIX
           
static String TEMP_TOPIC_PREFIX
           
static String TOPIC_PREFIX
           
 
Constructor Summary
JmsConfiguration()
           
JmsConfiguration(ConnectionFactory connectionFactory)
           
 
Method Summary
 AbstractMessageListenerContainer chooseMessageListenerContainerImplementation()
           
 void configure(EndpointMessageListener listener)
           
protected  void configuredQoS()
          When one of the QoS properties are configured such as setDeliveryPersistent(boolean), setPriority(int) or setTimeToLive(long) then we should auto default the setting of setExplicitQosEnabled(boolean) if its not been configured yet
protected  void configureMessageListenerContainer(AbstractMessageListenerContainer container, JmsEndpoint endpoint)
           
 JmsConfiguration copy()
          Returns a copy of this configuration
protected  ConnectionFactory createConnectionFactory()
          Factory method which allows derived classes to customize the lazy creation
static DestinationResolver createDestinationResolver(DestinationEndpoint destinationEndpoint)
           
 JmsOperations createInOnlyTemplate(JmsEndpoint endpoint, boolean pubSubDomain, String destination)
          Creates a JmsOperations object used for one way messaging
 JmsOperations createInOutTemplate(JmsEndpoint endpoint, boolean pubSubDomain, String destination, long requestTimeout)
          Creates a JmsOperations object used for request/response using a request timeout value
protected  ConnectionFactory createListenerConnectionFactory()
          Factory method which allows derived classes to customize the lazy creation
 AbstractMessageListenerContainer createMessageListenerContainer(JmsEndpoint endpoint)
           
protected  ConnectionFactory createTemplateConnectionFactory()
          Factory method which allows derived classes to customize the lazy creation
protected  PlatformTransactionManager createTransactionManager()
          Factory method which which allows derived classes to customize the lazy transcationManager creation
protected  int defaultCacheLevel(JmsEndpoint endpoint)
          Defaults the JMS cache level if none is explicitly specified.
 int getAcknowledgementMode()
           
 String getAcknowledgementModeName()
           
 int getCacheLevel()
           
 String getCacheLevelName()
           
 String getClientId()
           
 int getConcurrentConsumers()
           
 ConnectionFactory getConnectionFactory()
           
 ConsumerType getConsumerType()
           
 DestinationResolver getDestinationResolver()
           
 String getDurableSubscriptionName()
           
 ExceptionListener getExceptionListener()
           
 int getIdleTaskExecutionLimit()
           
 JmsKeyFormatStrategy getJmsKeyFormatStrategy()
           
 JmsMessageType getJmsMessageType()
           
 JmsOperations getJmsOperations()
           
 ConnectionFactory getListenerConnectionFactory()
           
 int getMaxConcurrentConsumers()
           
 int getMaxMessagesPerTask()
           
 MessageConverter getMessageConverter()
           
 JmsOperations getMetadataJmsOperations(JmsEndpoint endpoint)
           
 int getPriority()
           
 JmsProviderMetadata getProviderMetadata()
           
 long getReceiveTimeout()
           
 long getRecoveryInterval()
           
 String getReplyTo()
           
 String getReplyToDestinationSelectorName()
           
 long getRequestTimeout()
           
 TaskExecutor getTaskExecutor()
           
 Object getTaskExecutorSpring2()
           
 ConnectionFactory getTemplateConnectionFactory()
           
 long getTimeToLive()
           
 PlatformTransactionManager getTransactionManager()
           
 String getTransactionName()
           
 int getTransactionTimeout()
           
 boolean isAcceptMessagesWhileStopping()
           
 boolean isAlwaysCopyMessage()
           
 boolean isAutoStartup()
           
 boolean isDeliveryPersistent()
           
 boolean isDisableReplyTo()
           
 boolean isEagerLoadingOfProperties()
           
 boolean isExplicitQosEnabled()
           
 boolean isExposeListenerSession()
           
 boolean isLazyCreateTransactionManager()
           
 boolean isMapJmsMessage()
           
 boolean isMessageIdEnabled()
           
 boolean isMessageTimestampEnabled()
           
 boolean isPreserveMessageQos()
           
 boolean isPubSubNoLocal()
           
 boolean isReplyToDeliveryPersistent()
           
 boolean isSubscriptionDurable()
          Deprecated. 
 boolean isTestConnectionOnStartup()
           
 boolean isTransacted()
           
 boolean isTransactedInOut()
          Deprecated. 
 boolean isTransferException()
           
 boolean isTransferExchange()
           
 boolean isUseMessageIDAsCorrelationID()
           
 void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)
           
 void setAcknowledgementMode(int consumerAcknowledgementMode)
           
 void setAcknowledgementModeName(String consumerAcknowledgementMode)
           
 void setAlwaysCopyMessage(boolean alwaysCopyMessage)
           
 void setAutoStartup(boolean autoStartup)
           
 void setCacheLevel(int cacheLevel)
           
 void setCacheLevelName(String cacheName)
           
 void setClientId(String consumerClientId)
           
 void setConcurrentConsumers(int concurrentConsumers)
           
 void setConnectionFactory(ConnectionFactory connectionFactory)
          Sets the default connection factory to be used if a connection factory is not specified for either setTemplateConnectionFactory(ConnectionFactory) or setListenerConnectionFactory(ConnectionFactory)
 void setConsumerType(ConsumerType consumerType)
           
 void setDeliveryPersistent(boolean deliveryPersistent)
           
 void setDestinationResolver(DestinationResolver destinationResolver)
           
 void setDisableReplyTo(boolean disableReplyTo)
          Disables the use of the JMSReplyTo header for consumers so that inbound messages are treated as InOnly rather than InOut requests.
 void setDurableSubscriptionName(String durableSubscriptionName)
           
 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 setExceptionListener(ExceptionListener exceptionListener)
           
 void setExplicitQosEnabled(boolean explicitQosEnabled)
           
 void setExposeListenerSession(boolean exposeListenerSession)
           
 void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)
           
 void setJmsKeyFormatStrategy(JmsKeyFormatStrategy jmsKeyFormatStrategy)
           
 void setJmsMessageType(JmsMessageType jmsMessageType)
           
 void setJmsOperations(JmsOperations jmsOperations)
           
 void setLazyCreateTransactionManager(boolean lazyCreating)
           
 void setListenerConnectionFactory(ConnectionFactory listenerConnectionFactory)
          Sets the connection factory to be used for consuming messages via the createMessageListenerContainer(JmsEndpoint)
 void setMapJmsMessage(boolean mapJmsMessage)
           
 void setMaxConcurrentConsumers(int maxConcurrentConsumers)
           
 void setMaxMessagesPerTask(int maxMessagesPerTask)
           
 void setMessageConverter(MessageConverter messageConverter)
           
 void setMessageIdEnabled(boolean messageIdEnabled)
           
 void setMessageTimestampEnabled(boolean messageTimestampEnabled)
           
 void setMetadataJmsOperations(JmsOperations metadataJmsOperations)
          Sets the JmsOperations used to deduce the JmsProviderMetadata details which if none is customized one is lazily created on demand
 void setPreserveMessageQos(boolean preserveMessageQos)
          Set to true if you want to send message using the QoS settings specified on the message.
 void setPriority(int priority)
           
 void setProviderMetadata(JmsProviderMetadata providerMetadata)
          Allows the provider metadata to be explicitly configured.
 void setPubSubNoLocal(boolean pubSubNoLocal)
           
 void setReceiveTimeout(long receiveTimeout)
           
 void setRecoveryInterval(long recoveryInterval)
           
 void setReplyTo(String replyToDestination)
           
 void setReplyToDeliveryPersistent(boolean replyToDeliveryPersistent)
           
 void setReplyToDestinationSelectorName(String replyToDestinationSelectorName)
           
 void setRequestTimeout(long requestTimeout)
          Sets the timeout in milliseconds which requests should timeout after
 void setSubscriptionDurable(boolean subscriptionDurable)
          Deprecated. 
 void setTaskExecutor(TaskExecutor taskExecutor)
           
 void setTaskExecutorSpring2(Object taskExecutorSpring2)
           
 void setTemplateConnectionFactory(ConnectionFactory templateConnectionFactory)
          Sets the connection factory to be used for sending messages via the JmsConfiguration.CamelJmsTemplate via createInOnlyTemplate(JmsEndpoint,boolean, String)
 void setTestConnectionOnStartup(boolean testConnectionOnStartup)
           
 void setTimeToLive(long timeToLive)
           
 void setTransacted(boolean consumerTransacted)
           
 void setTransactedInOut(boolean transactedInOut)
          Deprecated. 
 void setTransactionManager(PlatformTransactionManager transactionManager)
           
 void setTransactionName(String transactionName)
           
 void setTransactionTimeout(int transactionTimeout)
           
 void setTransferException(boolean transferException)
           
 void setTransferExchange(boolean transferExchange)
           
 void setUseMessageIDAsCorrelationID(boolean useMessageIDAsCorrelationID)
           
protected  boolean supportBlobMessage()
          Should get overridden by implementations which support BlobMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUEUE_PREFIX

public static final String QUEUE_PREFIX
See Also:
Constant Field Values

TOPIC_PREFIX

public static final String TOPIC_PREFIX
See Also:
Constant Field Values

TEMP_QUEUE_PREFIX

public static final String TEMP_QUEUE_PREFIX
See Also:
Constant Field Values

TEMP_TOPIC_PREFIX

public static final String TEMP_TOPIC_PREFIX
See Also:
Constant Field Values
Constructor Detail

JmsConfiguration

public JmsConfiguration()

JmsConfiguration

public JmsConfiguration(ConnectionFactory connectionFactory)
Method Detail

copy

public JmsConfiguration copy()
Returns a copy of this configuration


createInOutTemplate

public JmsOperations createInOutTemplate(JmsEndpoint endpoint,
                                         boolean pubSubDomain,
                                         String destination,
                                         long requestTimeout)
Creates a JmsOperations object used for request/response using a request timeout value


createInOnlyTemplate

public JmsOperations createInOnlyTemplate(JmsEndpoint endpoint,
                                          boolean pubSubDomain,
                                          String destination)
Creates a JmsOperations object used for one way messaging


createMessageListenerContainer

public AbstractMessageListenerContainer createMessageListenerContainer(JmsEndpoint endpoint)

getConnectionFactory

public ConnectionFactory getConnectionFactory()

setConnectionFactory

public void setConnectionFactory(ConnectionFactory connectionFactory)
Sets the default connection factory to be used if a connection factory is not specified for either setTemplateConnectionFactory(ConnectionFactory) or setListenerConnectionFactory(ConnectionFactory)

Parameters:
connectionFactory - the default connection factory to use

getListenerConnectionFactory

public ConnectionFactory getListenerConnectionFactory()

setListenerConnectionFactory

public void setListenerConnectionFactory(ConnectionFactory listenerConnectionFactory)
Sets the connection factory to be used for consuming messages via the createMessageListenerContainer(JmsEndpoint)

Parameters:
listenerConnectionFactory - the connection factory to use for consuming messages

getTemplateConnectionFactory

public ConnectionFactory getTemplateConnectionFactory()

setTemplateConnectionFactory

public void setTemplateConnectionFactory(ConnectionFactory templateConnectionFactory)
Sets the connection factory to be used for sending messages via the JmsConfiguration.CamelJmsTemplate via createInOnlyTemplate(JmsEndpoint,boolean, String)

Parameters:
templateConnectionFactory - the connection factory for sending messages

isAutoStartup

public boolean isAutoStartup()

setAutoStartup

public void setAutoStartup(boolean autoStartup)

isAcceptMessagesWhileStopping

public boolean isAcceptMessagesWhileStopping()

setAcceptMessagesWhileStopping

public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping)

getClientId

public String getClientId()

setClientId

public void setClientId(String consumerClientId)

getDurableSubscriptionName

public String getDurableSubscriptionName()

setDurableSubscriptionName

public void setDurableSubscriptionName(String durableSubscriptionName)

getExceptionListener

public ExceptionListener getExceptionListener()

setExceptionListener

public void setExceptionListener(ExceptionListener exceptionListener)

isSubscriptionDurable

@Deprecated
public boolean isSubscriptionDurable()
Deprecated. 


setSubscriptionDurable

@Deprecated
public void setSubscriptionDurable(boolean subscriptionDurable)
Deprecated. 


getAcknowledgementModeName

public String getAcknowledgementModeName()

setAcknowledgementModeName

public void setAcknowledgementModeName(String consumerAcknowledgementMode)

isExposeListenerSession

public boolean isExposeListenerSession()

setExposeListenerSession

public void setExposeListenerSession(boolean exposeListenerSession)

getTaskExecutor

public TaskExecutor getTaskExecutor()

setTaskExecutor

public void setTaskExecutor(TaskExecutor taskExecutor)

getTaskExecutorSpring2

public Object getTaskExecutorSpring2()

setTaskExecutorSpring2

public void setTaskExecutorSpring2(Object taskExecutorSpring2)

isPubSubNoLocal

public boolean isPubSubNoLocal()

setPubSubNoLocal

public void setPubSubNoLocal(boolean pubSubNoLocal)

getConcurrentConsumers

public int getConcurrentConsumers()

setConcurrentConsumers

public void setConcurrentConsumers(int concurrentConsumers)

getMaxMessagesPerTask

public int getMaxMessagesPerTask()

setMaxMessagesPerTask

public void setMaxMessagesPerTask(int maxMessagesPerTask)

getCacheLevel

public int getCacheLevel()

setCacheLevel

public void setCacheLevel(int cacheLevel)

getCacheLevelName

public String getCacheLevelName()

setCacheLevelName

public void setCacheLevelName(String cacheName)

getRecoveryInterval

public long getRecoveryInterval()

setRecoveryInterval

public void setRecoveryInterval(long recoveryInterval)

getReceiveTimeout

public long getReceiveTimeout()

setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)

getTransactionManager

public PlatformTransactionManager getTransactionManager()

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)

getTransactionName

public String getTransactionName()

setTransactionName

public void setTransactionName(String transactionName)

getTransactionTimeout

public int getTransactionTimeout()

setTransactionTimeout

public void setTransactionTimeout(int transactionTimeout)

getIdleTaskExecutionLimit

public int getIdleTaskExecutionLimit()

setIdleTaskExecutionLimit

public void setIdleTaskExecutionLimit(int idleTaskExecutionLimit)

getMaxConcurrentConsumers

public int getMaxConcurrentConsumers()

setMaxConcurrentConsumers

public void setMaxConcurrentConsumers(int maxConcurrentConsumers)

isExplicitQosEnabled

public boolean isExplicitQosEnabled()

setExplicitQosEnabled

public void setExplicitQosEnabled(boolean explicitQosEnabled)

isDeliveryPersistent

public boolean isDeliveryPersistent()

setDeliveryPersistent

public void setDeliveryPersistent(boolean deliveryPersistent)

isReplyToDeliveryPersistent

public boolean isReplyToDeliveryPersistent()

setReplyToDeliveryPersistent

public void setReplyToDeliveryPersistent(boolean replyToDeliveryPersistent)

getTimeToLive

public long getTimeToLive()

setTimeToLive

public void setTimeToLive(long timeToLive)

getMessageConverter

public MessageConverter getMessageConverter()

setMessageConverter

public void setMessageConverter(MessageConverter messageConverter)

isMapJmsMessage

public boolean isMapJmsMessage()

setMapJmsMessage

public void setMapJmsMessage(boolean mapJmsMessage)

isMessageIdEnabled

public boolean isMessageIdEnabled()

setMessageIdEnabled

public void setMessageIdEnabled(boolean messageIdEnabled)

isMessageTimestampEnabled

public boolean isMessageTimestampEnabled()

setMessageTimestampEnabled

public void setMessageTimestampEnabled(boolean messageTimestampEnabled)

getPriority

public int getPriority()

setPriority

public void setPriority(int priority)

getConsumerType

public ConsumerType getConsumerType()

setConsumerType

public void setConsumerType(ConsumerType consumerType)

getAcknowledgementMode

public int getAcknowledgementMode()

setAcknowledgementMode

public void setAcknowledgementMode(int consumerAcknowledgementMode)

isTransacted

public boolean isTransacted()

setTransacted

public void setTransacted(boolean consumerTransacted)

isTransactedInOut

@Deprecated
public boolean isTransactedInOut()
Deprecated. 

Should InOut operations (request reply) default to using transacted mode?

By default this is false as you need to commit the outgoing request before you can consume the input


setTransactedInOut

@Deprecated
public void setTransactedInOut(boolean transactedInOut)
Deprecated. 


isLazyCreateTransactionManager

public boolean isLazyCreateTransactionManager()

setLazyCreateTransactionManager

public void setLazyCreateTransactionManager(boolean lazyCreating)

isEagerLoadingOfProperties

public boolean isEagerLoadingOfProperties()

setEagerLoadingOfProperties

public 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

Parameters:
eagerLoadingOfProperties - whether or not to enable eager loading of JMS properties on inbound messages

isDisableReplyTo

public boolean isDisableReplyTo()

setDisableReplyTo

public void setDisableReplyTo(boolean disableReplyTo)
Disables the use of the JMSReplyTo header for consumers so that inbound messages are treated as InOnly rather than InOut requests.

Parameters:
disableReplyTo - whether or not to disable the use of JMSReplyTo header indicating an InOut

setPreserveMessageQos

public void setPreserveMessageQos(boolean preserveMessageQos)
Set to true if you want to send message using the QoS settings specified on the message. Normally the QoS settings used are the one configured on this Object.


getJmsOperations

public JmsOperations getJmsOperations()

setJmsOperations

public void setJmsOperations(JmsOperations jmsOperations)

getDestinationResolver

public DestinationResolver getDestinationResolver()

setDestinationResolver

public void setDestinationResolver(DestinationResolver destinationResolver)

getProviderMetadata

public JmsProviderMetadata getProviderMetadata()

setProviderMetadata

public void setProviderMetadata(JmsProviderMetadata providerMetadata)
Allows the provider metadata to be explicitly configured. Typically this is not required and Camel will auto-detect the provider metadata from the underlying provider.


getMetadataJmsOperations

public JmsOperations getMetadataJmsOperations(JmsEndpoint endpoint)

setMetadataJmsOperations

public void setMetadataJmsOperations(JmsOperations metadataJmsOperations)
Sets the JmsOperations used to deduce the JmsProviderMetadata details which if none is customized one is lazily created on demand


createDestinationResolver

public static DestinationResolver createDestinationResolver(DestinationEndpoint destinationEndpoint)

configureMessageListenerContainer

protected void configureMessageListenerContainer(AbstractMessageListenerContainer container,
                                                 JmsEndpoint endpoint)

configure

public void configure(EndpointMessageListener listener)

chooseMessageListenerContainerImplementation

public AbstractMessageListenerContainer chooseMessageListenerContainerImplementation()

defaultCacheLevel

protected int defaultCacheLevel(JmsEndpoint endpoint)
Defaults the JMS cache level if none is explicitly specified. Note that due to this Spring Bug we cannot use CACHE_CONSUMER by default (which we should do as its most efficient) unless the spring version is 2.5.1 or later. Instead we use CACHE_CONNECTION - part from for non-durable topics which must use CACHE_CONSUMER to avoid missing messages (due to the consumer being created and destroyed per message).

Parameters:
endpoint - the endpoint
Returns:
the cache level

createConnectionFactory

protected ConnectionFactory createConnectionFactory()
Factory method which allows derived classes to customize the lazy creation


createListenerConnectionFactory

protected ConnectionFactory createListenerConnectionFactory()
Factory method which allows derived classes to customize the lazy creation


createTemplateConnectionFactory

protected ConnectionFactory createTemplateConnectionFactory()
Factory method which allows derived classes to customize the lazy creation


createTransactionManager

protected PlatformTransactionManager createTransactionManager()
Factory method which which allows derived classes to customize the lazy transcationManager creation


isPreserveMessageQos

public boolean isPreserveMessageQos()

configuredQoS

protected void configuredQoS()
When one of the QoS properties are configured such as setDeliveryPersistent(boolean), setPriority(int) or setTimeToLive(long) then we should auto default the setting of setExplicitQosEnabled(boolean) if its not been configured yet


isAlwaysCopyMessage

public boolean isAlwaysCopyMessage()

setAlwaysCopyMessage

public void setAlwaysCopyMessage(boolean alwaysCopyMessage)

isUseMessageIDAsCorrelationID

public boolean isUseMessageIDAsCorrelationID()

setUseMessageIDAsCorrelationID

public void setUseMessageIDAsCorrelationID(boolean useMessageIDAsCorrelationID)

getRequestTimeout

public long getRequestTimeout()

setRequestTimeout

public void setRequestTimeout(long requestTimeout)
Sets the timeout in milliseconds which requests should timeout after


getReplyTo

public String getReplyTo()

setReplyTo

public void setReplyTo(String replyToDestination)

getReplyToDestinationSelectorName

public String getReplyToDestinationSelectorName()

setReplyToDestinationSelectorName

public void setReplyToDestinationSelectorName(String replyToDestinationSelectorName)

getJmsMessageType

public JmsMessageType getJmsMessageType()

setJmsMessageType

public void setJmsMessageType(JmsMessageType jmsMessageType)

supportBlobMessage

protected boolean supportBlobMessage()
Should get overridden by implementations which support BlobMessages

Returns:
false

getJmsKeyFormatStrategy

public JmsKeyFormatStrategy getJmsKeyFormatStrategy()

setJmsKeyFormatStrategy

public void setJmsKeyFormatStrategy(JmsKeyFormatStrategy jmsKeyFormatStrategy)

isTransferExchange

public boolean isTransferExchange()

setTransferExchange

public void setTransferExchange(boolean transferExchange)

isTransferException

public boolean isTransferException()

setTransferException

public void setTransferException(boolean transferException)

isTestConnectionOnStartup

public boolean isTestConnectionOnStartup()

setTestConnectionOnStartup

public void setTestConnectionOnStartup(boolean testConnectionOnStartup)


Apache CAMEL