Package org.apache.activemq
Class ActiveMQConnectionFactory
java.lang.Object
org.apache.activemq.jndi.JNDIBaseStorable
org.apache.activemq.ActiveMQConnectionFactory
- All Implemented Interfaces:
jakarta.jms.ConnectionFactory
,jakarta.jms.QueueConnectionFactory
,jakarta.jms.TopicConnectionFactory
,Externalizable
,Serializable
,Cloneable
,Referenceable
,JNDIStorableInterface
,StatsCapable
- Direct Known Subclasses:
ActiveMQSslConnectionFactory
,ActiveMQXAConnectionFactory
public class ActiveMQConnectionFactory
extends JNDIBaseStorable
implements jakarta.jms.ConnectionFactory, jakarta.jms.QueueConnectionFactory, jakarta.jms.TopicConnectionFactory, StatsCapable, Cloneable
A ConnectionFactory is an an Administered object, and is used for creating
Connections. This class also implements QueueConnectionFactory and
TopicConnectionFactory. You can use this connection to create both
QueueConnections and TopicConnections.
- See Also:
-
ConnectionFactory
- Serialized Form
-
Field Summary
-
Constructor Summary
ConstructorDescriptionActiveMQConnectionFactory
(String brokerURL) ActiveMQConnectionFactory
(String userName, String password, String brokerURL) ActiveMQConnectionFactory
(String userName, String password, URI brokerURL) ActiveMQConnectionFactory
(URI brokerURL) -
Method Summary
Modifier and TypeMethodDescriptionboolean
buildFromMap
(Map<String, Object> properties) void
buildFromProperties
(Properties properties) Set the properties that will represent the instance in JNDIprotected void
configureConnection
(ActiveMQConnection connection) copy()
Returns a copy of the given connection factoryprotected ActiveMQConnection
protected ActiveMQConnection
createActiveMQConnection
(String userName, String password) protected ActiveMQConnection
createActiveMQConnection
(Transport transport, JMSStatsImpl stats) jakarta.jms.Connection
jakarta.jms.Connection
createConnection
(String userName, String password) jakarta.jms.JMSContext
jakarta.jms.JMSContext
createContext
(int sessionMode) jakarta.jms.JMSContext
createContext
(String userName, String password) jakarta.jms.JMSContext
createContext
(String userName, String password, int sessionMode) jakarta.jms.QueueConnection
jakarta.jms.QueueConnection
createQueueConnection
(String userName, String password) jakarta.jms.TopicConnection
jakarta.jms.TopicConnection
createTopicConnection
(String userName, String password) protected Transport
Creates a Transport based on this object's connection settings.int
int
protected IdGenerator
int
protected IdGenerator
int
long
jakarta.jms.ExceptionListener
int
long
long
Gets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled to send an ack for any outstanding Message Acks.int
int
getStats()
long
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
populateProperties
(Properties props) Initialize the instance from properties stored in JNDIvoid
setAlwaysSessionAsync
(boolean alwaysSessionAsync) If this flag is not set then a separate thread is not used for dispatching messages for each Session in the Connection.void
setAlwaysSyncSend
(boolean alwaysSyncSend) Set true if always require messages to be sync sentvoid
setAuditDepth
(int auditDepth) void
setAuditMaximumProducerNumber
(int auditMaximumProducerNumber) void
setBlobTransferPolicy
(BlobTransferPolicy blobTransferPolicy) Sets the policy used to describe how out-of-band BLOBs (Binary Large OBjects) are transferred from producers to brokers to consumersvoid
setBrokerURL
(String brokerURL) Sets the connection URL used to connect to the ActiveMQ broker.void
setCheckForDuplicates
(boolean checkForDuplicates) void
setClientID
(String clientID) Sets the JMS clientID to use for the created connection.protected void
setClientIdGenerator
(IdGenerator clientIdGenerator) void
setClientIDPrefix
(String clientIDPrefix) Sets the prefix used by autogenerated JMS Client ID values which are used if the JMS client does not explicitly specify on.void
setClientInternalExceptionListener
(ClientInternalExceptionListener clientInternalExceptionListener) Allows anClientInternalExceptionListener
to be configured on the ConnectionFactory so that when this factory is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register an exception listener.void
setCloseTimeout
(int closeTimeout) Sets the timeout before a close is considered complete.protected void
setConnectionIdGenerator
(IdGenerator connectionIdGenerator) void
setConnectionIDPrefix
(String connectionIDPrefix) Sets the prefix used by connection id generatorvoid
setConnectResponseTimeout
(int connectResponseTimeout) void
setConsumerExpiryCheckEnabled
(boolean consumerExpiryCheckEnabled) Controls whether message expiration checking is done in each MessageConsumer prior to dispatching a message.void
setConsumerFailoverRedeliveryWaitPeriod
(long consumerFailoverRedeliveryWaitPeriod) void
setCopyMessageOnSend
(boolean copyMessageOnSend) Should a JMS message be copied to a new JMS Message object as part of the send() method in JMS.void
setDisableTimeStampsByDefault
(boolean disableTimeStampsByDefault) Sets whether or not timestamps on messages should be disabled or not.void
setDispatchAsync
(boolean asyncDispatch) Enables or disables the default setting of whether or not consumers have their messages dispatched synchronously or asynchronously by the broker.void
setExceptionListener
(jakarta.jms.ExceptionListener exceptionListener) Allows anExceptionListener
to be configured on the ConnectionFactory so that when this factory is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register an exception listener.void
setExclusiveConsumer
(boolean exclusiveConsumer) Enables or disables whether or not queue consumers should be exclusive or not for example to preserve ordering when not using Message Groupsvoid
setMaxThreadPoolSize
(int maxThreadPoolSize) void
setMessagePrioritySupported
(boolean messagePrioritySupported) void
setNestedMapAndListEnabled
(boolean structuredMapsEnabled) Enables/disables whether or not Message properties and MapMessage entries support Nested Structures of Map and List objectsvoid
setNonBlockingRedelivery
(boolean nonBlockingRedelivery) When true a MessageConsumer will not stop Message delivery before re-delivering Messages from a rolled back transaction.void
setObjectMessageSerializationDefered
(boolean objectMessageSerializationDefered) When an object is set on an ObjectMessage, the JMS spec requires the object to be serialized by that set method.void
setOptimizeAcknowledge
(boolean optimizeAcknowledge) void
setOptimizeAcknowledgeTimeOut
(long optimizeAcknowledgeTimeOut) The max time in milliseconds between optimized ack batchesvoid
setOptimizedAckScheduledAckInterval
(long optimizedAckScheduledAckInterval) Sets the amount of time between scheduled sends of any outstanding Message Acks for consumers that have been configured with optimizeAcknowledge enabled.void
setOptimizedMessageDispatch
(boolean optimizedMessageDispatch) If this flag is set then an larger prefetch limit is used - only applicable for durable topic subscribers.void
setPassword
(String password) Sets the JMS password used for connections created from this factoryvoid
setPrefetchPolicy
(ActiveMQPrefetchPolicy prefetchPolicy) Sets the prefetch policy for consumers created by this connection.void
setProducerWindowSize
(int producerWindowSize) void
setRedeliveryPolicy
(RedeliveryPolicy redeliveryPolicy) Sets the global default redelivery policy to be used when a message is delivered but the session is rolled backvoid
setRedeliveryPolicyMap
(RedeliveryPolicyMap redeliveryPolicyMap) Sets the global redelivery policy mapping to be used when a message is delivered but the session is rolled backvoid
setRejectedTaskHandler
(RejectedExecutionHandler rejectedTaskHandler) void
setRmIdFromConnectionId
(boolean rmIdFromConnectionId) uses the connection id as the resource identity for XAResource.isSameRM ensuring join will only occur on a single connectionvoid
setSendAcksAsync
(boolean sendAcksAsync) void
setSendTimeout
(int sendTimeout) void
setSessionTaskRunner
(TaskRunnerFactory sessionTaskRunner) void
setStatsEnabled
(boolean statsEnabled) void
setTransactedIndividualAck
(boolean transactedIndividualAck) when true, submit individual transacted acks immediately rather than with transaction completion.void
setTransformer
(MessageTransformer transformer) Sets the transformer used to transform messages before they are sent on to the JMS bus or when they are received from the bus but before they are delivered to the JMS clientvoid
setTransportListener
(TransportListener transportListener) Allows a listener to be configured on the ConnectionFactory so that when this factory is used with frameworks which don't expose the Connection such as Spring JmsTemplate, you can still register a transport listener.void
setTrustAllPackages
(boolean trustAllPackages) void
setTrustedPackages
(List<String> trustedPackages) void
setUseAsyncSend
(boolean useAsyncSend) Forces the use of Async Sends which adds a massive performance boost; but means that the send() method will return immediately whether the message has been sent or not which could lead to message loss.void
setUseCompression
(boolean useCompression) Enables the use of compression of the message bodiesvoid
setUseDedicatedTaskRunner
(boolean useDedicatedTaskRunner) void
setUseRetroactiveConsumer
(boolean useRetroactiveConsumer) Sets whether or not retroactive consumers are enabled.void
setUserName
(String userName) Sets the JMS userName used by connections created by this factoryvoid
setWarnAboutUnstartedConnectionTimeout
(long warnAboutUnstartedConnectionTimeout) Enables the timeout from a connection creation to when a warning is generated if the connection is not properly started viaConnection.start()
and a message is received by a consumer.void
setWatchTopicAdvisories
(boolean watchTopicAdvisories) Methods inherited from class org.apache.activemq.jndi.JNDIBaseStorable
getProperties, getReference, readExternal, setProperties, writeExternal
-
Field Details
-
DEFAULT_BROKER_BIND_URL
-
DEFAULT_BROKER_URL
-
DEFAULT_USER
-
DEFAULT_PASSWORD
-
DEFAULT_PRODUCER_WINDOW_SIZE
public static final int DEFAULT_PRODUCER_WINDOW_SIZE- See Also:
-
brokerURL
-
userName
-
password
-
clientID
-
dispatchAsync
protected boolean dispatchAsync -
alwaysSessionAsync
protected boolean alwaysSessionAsync -
xaAckMode
protected int xaAckMode
-
-
Constructor Details
-
ActiveMQConnectionFactory
public ActiveMQConnectionFactory() -
ActiveMQConnectionFactory
-
ActiveMQConnectionFactory
-
ActiveMQConnectionFactory
-
ActiveMQConnectionFactory
-
-
Method Details
-
copy
Returns a copy of the given connection factory -
createConnection
public jakarta.jms.Connection createConnection() throws jakarta.jms.JMSException- Specified by:
createConnection
in interfacejakarta.jms.ConnectionFactory
- Returns:
- Returns the Connection.
- Throws:
jakarta.jms.JMSException
-
createConnection
public jakarta.jms.Connection createConnection(String userName, String password) throws jakarta.jms.JMSException - Specified by:
createConnection
in interfacejakarta.jms.ConnectionFactory
- Returns:
- Returns the Connection.
- Throws:
jakarta.jms.JMSException
-
createQueueConnection
public jakarta.jms.QueueConnection createQueueConnection() throws jakarta.jms.JMSException- Specified by:
createQueueConnection
in interfacejakarta.jms.QueueConnectionFactory
- Returns:
- Returns the QueueConnection.
- Throws:
jakarta.jms.JMSException
-
createQueueConnection
public jakarta.jms.QueueConnection createQueueConnection(String userName, String password) throws jakarta.jms.JMSException - Specified by:
createQueueConnection
in interfacejakarta.jms.QueueConnectionFactory
- Returns:
- Returns the QueueConnection.
- Throws:
jakarta.jms.JMSException
-
createTopicConnection
public jakarta.jms.TopicConnection createTopicConnection() throws jakarta.jms.JMSException- Specified by:
createTopicConnection
in interfacejakarta.jms.TopicConnectionFactory
- Returns:
- Returns the TopicConnection.
- Throws:
jakarta.jms.JMSException
-
createTopicConnection
public jakarta.jms.TopicConnection createTopicConnection(String userName, String password) throws jakarta.jms.JMSException - Specified by:
createTopicConnection
in interfacejakarta.jms.TopicConnectionFactory
- Returns:
- Returns the TopicConnection.
- Throws:
jakarta.jms.JMSException
-
createContext
public jakarta.jms.JMSContext createContext()- Specified by:
createContext
in interfacejakarta.jms.ConnectionFactory
- Returns:
- Returns the JMSContext.
-
createContext
- Specified by:
createContext
in interfacejakarta.jms.ConnectionFactory
- Returns:
- Returns the JMSContext.
-
createContext
- Specified by:
createContext
in interfacejakarta.jms.ConnectionFactory
- Returns:
- Returns the JMSContext.
-
createContext
public jakarta.jms.JMSContext createContext(int sessionMode) - Specified by:
createContext
in interfacejakarta.jms.ConnectionFactory
- Returns:
- Returns the JMSContext.
-
getStats
- Specified by:
getStats
in interfaceStatsCapable
- Returns:
- the StatsImpl associated with this ConnectionFactory.
-
createActiveMQConnection
- Throws:
jakarta.jms.JMSException
-
createTransport
Creates a Transport based on this object's connection settings. Separated from createActiveMQConnection to allow for subclasses to override.- Returns:
- The newly created Transport.
- Throws:
jakarta.jms.JMSException
- If unable to create trasnport.
-
createActiveMQConnection
protected ActiveMQConnection createActiveMQConnection(String userName, String password) throws jakarta.jms.JMSException - Returns:
- Returns the Connection.
- Throws:
jakarta.jms.JMSException
-
createActiveMQConnection
protected ActiveMQConnection createActiveMQConnection(Transport transport, JMSStatsImpl stats) throws Exception - Throws:
Exception
-
configureConnection
- Throws:
jakarta.jms.JMSException
-
getBrokerURL
-
setBrokerURL
Sets the connection URL used to connect to the ActiveMQ broker. -
getClientID
-
setClientID
Sets the JMS clientID to use for the created connection. Note that this can only be used by one connection at once so generally its a better idea to set the clientID on a Connection -
isCopyMessageOnSend
public boolean isCopyMessageOnSend() -
setCopyMessageOnSend
public void setCopyMessageOnSend(boolean copyMessageOnSend) Should a JMS message be copied to a new JMS Message object as part of the send() method in JMS. This is enabled by default to be compliant with the JMS specification. You can disable it if you do not mutate JMS messages after they are sent for a performance boost -
isDisableTimeStampsByDefault
public boolean isDisableTimeStampsByDefault() -
setDisableTimeStampsByDefault
public void setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault) Sets whether or not timestamps on messages should be disabled or not. If you disable them it adds a small performance boost. -
isOptimizedMessageDispatch
public boolean isOptimizedMessageDispatch() -
setOptimizedMessageDispatch
public void setOptimizedMessageDispatch(boolean optimizedMessageDispatch) If this flag is set then an larger prefetch limit is used - only applicable for durable topic subscribers. -
getPassword
-
setPassword
Sets the JMS password used for connections created from this factory -
getPrefetchPolicy
-
setPrefetchPolicy
Sets the prefetch policy for consumers created by this connection. -
isUseAsyncSend
public boolean isUseAsyncSend() -
getBlobTransferPolicy
-
setBlobTransferPolicy
Sets the policy used to describe how out-of-band BLOBs (Binary Large OBjects) are transferred from producers to brokers to consumers -
setUseAsyncSend
public void setUseAsyncSend(boolean useAsyncSend) Forces the use of Async Sends which adds a massive performance boost; but means that the send() method will return immediately whether the message has been sent or not which could lead to message loss. -
isWatchTopicAdvisories
public boolean isWatchTopicAdvisories() -
setWatchTopicAdvisories
public void setWatchTopicAdvisories(boolean watchTopicAdvisories) -
isAlwaysSyncSend
public boolean isAlwaysSyncSend()- Returns:
- true if always sync send messages
-
setAlwaysSyncSend
public void setAlwaysSyncSend(boolean alwaysSyncSend) Set true if always require messages to be sync sent- Parameters:
alwaysSyncSend
-
-
getUserName
-
setUserName
Sets the JMS userName used by connections created by this factory -
isUseRetroactiveConsumer
public boolean isUseRetroactiveConsumer() -
setUseRetroactiveConsumer
public void setUseRetroactiveConsumer(boolean useRetroactiveConsumer) Sets whether or not retroactive consumers are enabled. Retroactive consumers allow non-durable topic subscribers to receive old messages that were published before the non-durable subscriber started. -
isExclusiveConsumer
public boolean isExclusiveConsumer() -
setExclusiveConsumer
public void setExclusiveConsumer(boolean exclusiveConsumer) Enables or disables whether or not queue consumers should be exclusive or not for example to preserve ordering when not using Message Groups- Parameters:
exclusiveConsumer
-
-
getRedeliveryPolicy
-
setRedeliveryPolicy
Sets the global default redelivery policy to be used when a message is delivered but the session is rolled back -
getRedeliveryPolicyMap
-
setRedeliveryPolicyMap
Sets the global redelivery policy mapping to be used when a message is delivered but the session is rolled back -
getTransformer
-
getSendTimeout
public int getSendTimeout()- Returns:
- the sendTimeout (in milliseconds)
-
setSendTimeout
public void setSendTimeout(int sendTimeout) - Parameters:
sendTimeout
- the sendTimeout to set (in milliseconds)
-
isSendAcksAsync
public boolean isSendAcksAsync()- Returns:
- the sendAcksAsync
-
setSendAcksAsync
public void setSendAcksAsync(boolean sendAcksAsync) - Parameters:
sendAcksAsync
- the sendAcksAsync to set
-
isMessagePrioritySupported
public boolean isMessagePrioritySupported()- Returns:
- the messagePrioritySupported
-
setMessagePrioritySupported
public void setMessagePrioritySupported(boolean messagePrioritySupported) - Parameters:
messagePrioritySupported
- the messagePrioritySupported to set
-
setTransformer
Sets the transformer used to transform messages before they are sent on to the JMS bus or when they are received from the bus but before they are delivered to the JMS client -
buildFromProperties
Description copied from class:JNDIBaseStorable
Set the properties that will represent the instance in JNDI- Specified by:
buildFromProperties
in classJNDIBaseStorable
-
buildFromMap
-
populateProperties
Description copied from class:JNDIBaseStorable
Initialize the instance from properties stored in JNDI- Specified by:
populateProperties
in classJNDIBaseStorable
-
isUseCompression
public boolean isUseCompression() -
setUseCompression
public void setUseCompression(boolean useCompression) Enables the use of compression of the message bodies -
isObjectMessageSerializationDefered
public boolean isObjectMessageSerializationDefered() -
setObjectMessageSerializationDefered
public void setObjectMessageSerializationDefered(boolean objectMessageSerializationDefered) When an object is set on an ObjectMessage, the JMS spec requires the object to be serialized by that set method. Enabling this flag causes the object to not get serialized. The object may subsequently get serialized if the message needs to be sent over a socket or stored to disk. -
isDispatchAsync
public boolean isDispatchAsync() -
setDispatchAsync
public void setDispatchAsync(boolean asyncDispatch) Enables or disables the default setting of whether or not consumers have their messages dispatched synchronously or asynchronously by the broker. For non-durable topics for example we typically dispatch synchronously by default to minimize context switches which boost performance. However sometimes its better to go slower to ensure that a single blocked consumer socket does not block delivery to other consumers.- Parameters:
asyncDispatch
- If true then consumers created on this connection will default to having their messages dispatched asynchronously. The default value is true.
-
getCloseTimeout
public int getCloseTimeout()- Returns:
- Returns the closeTimeout.
-
setCloseTimeout
public void setCloseTimeout(int closeTimeout) Sets the timeout before a close is considered complete. Normally a close() on a connection waits for confirmation from the broker; this allows that operation to timeout to save the client hanging if there is no broker -
isAlwaysSessionAsync
public boolean isAlwaysSessionAsync()- Returns:
- Returns the alwaysSessionAsync.
-
setAlwaysSessionAsync
public void setAlwaysSessionAsync(boolean alwaysSessionAsync) If this flag is not set then a separate thread is not used for dispatching messages for each Session in the Connection. However, a separate thread is always used if there is more than one session, or the session isn't in auto acknowledge or duplicates ok mode. By default this value is set to true and session dispatch happens asynchronously. -
isOptimizeAcknowledge
public boolean isOptimizeAcknowledge()- Returns:
- Returns the optimizeAcknowledge.
-
setOptimizeAcknowledge
public void setOptimizeAcknowledge(boolean optimizeAcknowledge) - Parameters:
optimizeAcknowledge
- The optimizeAcknowledge to set.
-
setOptimizeAcknowledgeTimeOut
public void setOptimizeAcknowledgeTimeOut(long optimizeAcknowledgeTimeOut) The max time in milliseconds between optimized ack batches- Parameters:
optimizeAcknowledgeTimeOut
-
-
getOptimizeAcknowledgeTimeOut
public long getOptimizeAcknowledgeTimeOut() -
isNestedMapAndListEnabled
public boolean isNestedMapAndListEnabled() -
setNestedMapAndListEnabled
public void setNestedMapAndListEnabled(boolean structuredMapsEnabled) Enables/disables whether or not Message properties and MapMessage entries support Nested Structures of Map and List objects -
getClientIDPrefix
-
setClientIDPrefix
Sets the prefix used by autogenerated JMS Client ID values which are used if the JMS client does not explicitly specify on.- Parameters:
clientIDPrefix
-
-
getClientIdGenerator
-
setClientIdGenerator
-
setConnectionIDPrefix
Sets the prefix used by connection id generator- Parameters:
connectionIDPrefix
-
-
getConnectionIdGenerator
-
setConnectionIdGenerator
-
isStatsEnabled
public boolean isStatsEnabled()- Returns:
- the statsEnabled
-
setStatsEnabled
public void setStatsEnabled(boolean statsEnabled) - Parameters:
statsEnabled
- the statsEnabled to set
-
getProducerWindowSize
public int getProducerWindowSize() -
setProducerWindowSize
public void setProducerWindowSize(int producerWindowSize) -
getWarnAboutUnstartedConnectionTimeout
public long getWarnAboutUnstartedConnectionTimeout() -
setWarnAboutUnstartedConnectionTimeout
public void setWarnAboutUnstartedConnectionTimeout(long warnAboutUnstartedConnectionTimeout) Enables the timeout from a connection creation to when a warning is generated if the connection is not properly started viaConnection.start()
and a message is received by a consumer. It is a very common gotcha to forget to start the connection so this option makes the default case to create a warning if the user forgets. To disable the warning just set the value to < 0 (say -1). -
getTransportListener
-
setTransportListener
Allows a listener to be configured on the ConnectionFactory so that when this factory is used with frameworks which don't expose the Connection such as Spring JmsTemplate, you can still register a transport listener.- Parameters:
transportListener
- sets the listener to be registered on all connections created by this factory
-
getExceptionListener
public jakarta.jms.ExceptionListener getExceptionListener() -
setExceptionListener
public void setExceptionListener(jakarta.jms.ExceptionListener exceptionListener) Allows anExceptionListener
to be configured on the ConnectionFactory so that when this factory is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register an exception listener.Note: access to this exceptionLinstener will not be serialized if it is associated with more than on connection (as it will be if more than one connection is subsequently created by this connection factory)
- Parameters:
exceptionListener
- sets the exception listener to be registered on all connections created by this factory
-
getAuditDepth
public int getAuditDepth() -
setAuditDepth
public void setAuditDepth(int auditDepth) -
getAuditMaximumProducerNumber
public int getAuditMaximumProducerNumber() -
setAuditMaximumProducerNumber
public void setAuditMaximumProducerNumber(int auditMaximumProducerNumber) -
setUseDedicatedTaskRunner
public void setUseDedicatedTaskRunner(boolean useDedicatedTaskRunner) -
isUseDedicatedTaskRunner
public boolean isUseDedicatedTaskRunner() -
setConsumerFailoverRedeliveryWaitPeriod
public void setConsumerFailoverRedeliveryWaitPeriod(long consumerFailoverRedeliveryWaitPeriod) -
getConsumerFailoverRedeliveryWaitPeriod
public long getConsumerFailoverRedeliveryWaitPeriod() -
getClientInternalExceptionListener
-
setClientInternalExceptionListener
public void setClientInternalExceptionListener(ClientInternalExceptionListener clientInternalExceptionListener) Allows anClientInternalExceptionListener
to be configured on the ConnectionFactory so that when this factory is used by frameworks which don't expose the Connection such as Spring JmsTemplate, you can register an exception listener.Note: access to this clientInternalExceptionListener will not be serialized if it is associated with more than on connection (as it will be if more than one connection is subsequently created by this connection factory)
- Parameters:
clientInternalExceptionListener
- sets the exception listener to be registered on all connections created by this factory
-
isCheckForDuplicates
public boolean isCheckForDuplicates()- Returns:
- the checkForDuplicates
-
setCheckForDuplicates
public void setCheckForDuplicates(boolean checkForDuplicates) - Parameters:
checkForDuplicates
- the checkForDuplicates to set
-
isTransactedIndividualAck
public boolean isTransactedIndividualAck() -
setTransactedIndividualAck
public void setTransactedIndividualAck(boolean transactedIndividualAck) when true, submit individual transacted acks immediately rather than with transaction completion. This allows the acks to represent delivery status which can be persisted on rollback Used in conjunction with org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter#setRewriteOnRedelivery(boolean) true -
isNonBlockingRedelivery
public boolean isNonBlockingRedelivery() -
setNonBlockingRedelivery
public void setNonBlockingRedelivery(boolean nonBlockingRedelivery) When true a MessageConsumer will not stop Message delivery before re-delivering Messages from a rolled back transaction. This implies that message order will not be preserved and also will result in the TransactedIndividualAck option to be enabled. -
getMaxThreadPoolSize
public int getMaxThreadPoolSize() -
setMaxThreadPoolSize
public void setMaxThreadPoolSize(int maxThreadPoolSize) -
getSessionTaskRunner
-
setSessionTaskRunner
-
getRejectedTaskHandler
-
setRejectedTaskHandler
-
getOptimizedAckScheduledAckInterval
public long getOptimizedAckScheduledAckInterval()Gets the configured time interval that is used to force all MessageConsumers that have optimizedAcknowledge enabled to send an ack for any outstanding Message Acks. By default this value is set to zero meaning that the consumers will not do any background Message acknowledgment.- Returns:
- the scheduledOptimizedAckInterval
-
setOptimizedAckScheduledAckInterval
public void setOptimizedAckScheduledAckInterval(long optimizedAckScheduledAckInterval) Sets the amount of time between scheduled sends of any outstanding Message Acks for consumers that have been configured with optimizeAcknowledge enabled.- Parameters:
optimizedAckScheduledAckInterval
- the scheduledOptimizedAckInterval to set
-
isRmIdFromConnectionId
public boolean isRmIdFromConnectionId() -
setRmIdFromConnectionId
public void setRmIdFromConnectionId(boolean rmIdFromConnectionId) uses the connection id as the resource identity for XAResource.isSameRM ensuring join will only occur on a single connection -
isConsumerExpiryCheckEnabled
public boolean isConsumerExpiryCheckEnabled()- Returns:
- true if MessageConsumer instance will check for expired messages before dispatch.
-
setConsumerExpiryCheckEnabled
public void setConsumerExpiryCheckEnabled(boolean consumerExpiryCheckEnabled) Controls whether message expiration checking is done in each MessageConsumer prior to dispatching a message. Disabling this check can lead to consumption of expired messages.- Parameters:
consumerExpiryCheckEnabled
- controls whether expiration checking is done prior to dispatch.
-
getTrustedPackages
-
setTrustedPackages
-
isTrustAllPackages
public boolean isTrustAllPackages() -
setTrustAllPackages
public void setTrustAllPackages(boolean trustAllPackages) -
getConnectResponseTimeout
public int getConnectResponseTimeout() -
setConnectResponseTimeout
public void setConnectResponseTimeout(int connectResponseTimeout)
-