Class ActiveMQConnection
- All Implemented Interfaces:
jakarta.jms.Connection
,jakarta.jms.QueueConnection
,jakarta.jms.TopicConnection
,AutoCloseable
,Closeable
,EnhancedConnection
,StatsCapable
,TransportListener
- Direct Known Subclasses:
ActiveMQXAConnection
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
static final String
static final String
static int
static final String
protected boolean
protected AtomicInteger
-
Constructor Summary
ModifierConstructorDescriptionprotected
ActiveMQConnection
(Transport transport, IdGenerator clientIdGenerator, IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats) Construct anActiveMQConnection
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addConnectionConsumer
(ActiveMQConnectionConsumer connectionConsumer) Add a ConnectionConsumervoid
addDispatcher
(ConsumerId consumerId, ActiveMQDispatcher dispatcher) void
addProducer
(ProducerId producerId, ActiveMQMessageProducer producer) protected void
addSession
(ActiveMQSession session) Used internally for adding Sessions to the Connectionvoid
addTransportListener
(TransportListener transportListener) Adds a transport listener so that a client can be notified of events in the underlying transportvoid
asyncSendPacket
(Command command) send a Packet through the Connection - for internal use onlyvoid
changeUserInfo
(String userName, String password) Changes the associated username/password that is associated with this connection.void
Ensures that the clientID was manually specified and not auto-generated.protected void
simply throws an exception if the Connection is already closedprotected void
simply throws an exception if the Connection is already closed or the Transport has failedvoid
cleanup()
Cleans up this connection so that it's state is as if the connection was just created.void
Removes any TempDestinations that this connection has cached, ignoring any exceptions generated because the destination is in use as they should not be removed.void
close()
Closes the connection.protected BlobTransferPolicy
jakarta.jms.ConnectionConsumer
createConnectionConsumer
(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) Creates a connection consumer for this connection (optional operation).jakarta.jms.ConnectionConsumer
createConnectionConsumer
(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages, boolean noLocal) jakarta.jms.ConnectionConsumer
createConnectionConsumer
(jakarta.jms.Queue queue, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) Creates a connection consumer for this connection (optional operation).jakarta.jms.ConnectionConsumer
createConnectionConsumer
(jakarta.jms.Topic topic, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) Creates a connection consumer for this connection (optional operation).jakarta.jms.ConnectionConsumer
createDurableConnectionConsumer
(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) Create a durable connection consumer for this connection (optional operation).jakarta.jms.ConnectionConsumer
createDurableConnectionConsumer
(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages, boolean noLocal) Create a durable connection consumer for this connection (optional operation).jakarta.jms.QueueSession
createQueueSession
(boolean transacted, int acknowledgeMode) Creates aQueueSession
object.jakarta.jms.Session
Creates aSession
object.jakarta.jms.Session
createSession
(boolean transacted, int acknowledgeMode) Creates aSession
object.jakarta.jms.Session
createSession
(int acknowledgeMode) Creates aSession
object.jakarta.jms.ConnectionConsumer
createSharedConnectionConsumer
(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) jakarta.jms.ConnectionConsumer
createSharedDurableConnectionConsumer
(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) protected ActiveMQTempDestination
createTempDestination
(boolean topic) Create the DestinationInfo object for the temporary destination.jakarta.jms.TopicSession
createTopicSession
(boolean transacted, int acknowledgeMode) Creates aTopicSession
object.void
deleteTempDestination
(ActiveMQTempDestination destination) void
destroyDestination
(ActiveMQDestination destination) void
doCleanup
(boolean removeConnection) protected void
Send the ConnectionInfo to the BrokerReturns the broker information if it is available or null if it is not available yet.Returns the broker name if one is available or null if one is not available yet.Gets the client identifier for this connection.Gets theClientInternalExceptionListener
object for this connection.int
int
long
Returns theDestinationSource
object which can be used to listen to destinations being created or destroyed or to enquire about the current destinations available on the brokerjakarta.jms.ExceptionListener
Gets theExceptionListener
object for this connection.protected ThreadPoolExecutor
int
jakarta.jms.ConnectionMetaData
Gets the metadata for this connection.protected SessionId
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
Gets the Connection's configured RedeliveryPolicyMap which will be used by all the Consumers when dealing with transaction messages that have been rolled back.protected Scheduler
int
protected CopyOnWriteArrayList<ActiveMQSession>
getStats()
long
Returns the time this connection was createdlong
boolean
hasDispatcher
(ConsumerId consumerId) boolean
boolean
boolean
boolean
isClosed()
Returns true if the connection is closedboolean
Returns true if the connection is in the process of being closedboolean
boolean
boolean
isDeleted
(ActiveMQDestination dest) boolean
boolean
protected boolean
isDuplicate
(ActiveMQDispatcher dispatcher, Message message) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Returns true if this connection has been startedboolean
boolean
boolean
Returns true if the underlying transport has failedboolean
boolean
boolean
boolean
boolean
boolean
boolean
static ActiveMQConnection
A static helper method to create a new connectionstatic ActiveMQConnection
makeConnection
(String uri) A static helper method to create a new connectionstatic ActiveMQConnection
makeConnection
(String user, String password, String uri) A static helper method to create a new connectionvoid
onAsyncException
(Throwable error) Used for handling async exceptionsvoid
Handles async client internal exceptions.void
called to process a commandprotected void
onConnectionControl
(ConnectionControl command) protected void
onConsumerControl
(ConsumerControl command) void
onException
(IOException error) An unrecoverable exception has occured on the transportprotected void
protected void
removeConnectionConsumer
(ActiveMQConnectionConsumer connectionConsumer) Remove a ConnectionConsumerprotected void
removeDispatcher
(ActiveMQDispatcher dispatcher) void
removeDispatcher
(ConsumerId consumerId) void
removeProducer
(ProducerId producerId) protected void
removeSession
(ActiveMQSession session) Used interanlly for removing Sessions from a Connectionvoid
removeTransportListener
(TransportListener transportListener) protected void
rollbackDuplicate
(ActiveMQDispatcher dispatcher, Message message) 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.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
setCheckForDuplicates
(boolean checkForDuplicates) void
setClientID
(String newClientID) Sets the client identifier for this connection.void
Sets a client internal exception listener for this connection.void
setCloseTimeout
(int closeTimeout) Sets the timeout before a close is considered complete.void
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
setDefaultClientID
(String clientID) Sets the default client id that the connection will use if explicitly not set with the setClientId() call.void
setDisableTimeStampsByDefault
(boolean timeStampsDisableByDefault) 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 listener) Sets an exception listener for this connection.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) 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) Enables an optimised acknowledgement mode where messages are acknowledged in batches rather than individuallyvoid
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 dispatchOptimizedMessage) If this flag is set then an larger prefetch limit is used - only applicable for durable topic subscribers.protected void
setPassword
(String password) void
setPrefetchPolicy
(ActiveMQPrefetchPolicy prefetchPolicy) Sets the prefetch policy for consumers created by this connection.void
setProducerWindowSize
(int producerWindowSize) void
setRedeliveryPolicy
(RedeliveryPolicy redeliveryPolicy) Sets the redelivery policy to be used when messages are rolled backvoid
setRedeliveryPolicyMap
(RedeliveryPolicyMap redeliveryPolicyMap) Sets the Connection wide RedeliveryPolicyMap for handling messages that are being rolled back.void
setRejectedTaskHandler
(RejectedExecutionHandler rejectedTaskHandler) void
setRmIdFromConnectionId
(boolean rmIdFromConnectionId) void
setSendAcksAsync
(boolean sendAcksAsync) void
setSendTimeout
(int sendTimeout) void
setSessionTaskRunner
(TaskRunnerFactory sessionTaskRunner) void
setStatsEnabled
(boolean statsEnabled) void
setTransactedIndividualAck
(boolean transactedIndividualAck) 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
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.protected void
setUserName
(String userName) void
setWarnAboutUnstartedConnectionTimeout
(long warnAboutUnstartedConnectionTimeout) Enables the timeout from a connection creation to when a warning is generated if the connection is not properly started viastart()
and a message is received by a consumer.void
setWatchTopicAdvisories
(boolean watchTopicAdvisories) void
start()
Starts (or restarts) a connection's delivery of incoming messages.void
stop()
Temporarily stops a connection's delivery of incoming messages.syncSendPacket
(Command command) Send a packet through a Connection - for internal use onlysyncSendPacket
(Command command, int timeout) void
syncSendPacket
(Command command, AsyncCallback onComplete) Send a packet through a Connection - for internal use onlytoString()
protected void
transportFailed
(IOException error) protected void
void
The transport has suffered an interuption from which it hopes to recovervoid
The transport has resumed after an interuptionvoid
unsubscribe
(String name) Unsubscribes a durable subscription that has been created by a client.protected void
-
Field Details
-
DEFAULT_USER
-
DEFAULT_PASSWORD
-
DEFAULT_BROKER_URL
-
DEFAULT_THREAD_POOL_SIZE
public static int DEFAULT_THREAD_POOL_SIZE -
activeTempDestinations
-
dispatchAsync
protected boolean dispatchAsync -
alwaysSessionAsync
protected boolean alwaysSessionAsync -
transportInterruptionProcessingComplete
-
-
Constructor Details
-
ActiveMQConnection
protected ActiveMQConnection(Transport transport, IdGenerator clientIdGenerator, IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats) throws Exception Construct anActiveMQConnection
- Parameters:
transport
-factoryStats
-- Throws:
Exception
-
-
Method Details
-
setUserName
-
setPassword
-
makeConnection
A static helper method to create a new connection- Returns:
- an ActiveMQConnection
- Throws:
jakarta.jms.JMSException
-
makeConnection
public static ActiveMQConnection makeConnection(String uri) throws jakarta.jms.JMSException, URISyntaxException A static helper method to create a new connection- Parameters:
uri
-- Returns:
- and ActiveMQConnection
- Throws:
jakarta.jms.JMSException
URISyntaxException
-
makeConnection
public static ActiveMQConnection makeConnection(String user, String password, String uri) throws jakarta.jms.JMSException, URISyntaxException A static helper method to create a new connection- Parameters:
user
-password
-uri
-- Returns:
- an ActiveMQConnection
- Throws:
jakarta.jms.JMSException
URISyntaxException
-
getConnectionStats
- Returns:
- a number unique for this connection
-
createSession
public jakarta.jms.Session createSession() throws jakarta.jms.JMSExceptionCreates aSession
object.- Specified by:
createSession
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- if theConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.- Since:
- 2.0
-
createSession
public jakarta.jms.Session createSession(int acknowledgeMode) throws jakarta.jms.JMSException Creates aSession
object.- Specified by:
createSession
in interfacejakarta.jms.Connection
- Parameters:
acknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created session
- Throws:
jakarta.jms.JMSException
- if theConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.- Since:
- 2.0
- See Also:
-
Session.AUTO_ACKNOWLEDGE
Session.CLIENT_ACKNOWLEDGE
Session.DUPS_OK_ACKNOWLEDGE
-
createSession
public jakarta.jms.Session createSession(boolean transacted, int acknowledgeMode) throws jakarta.jms.JMSException Creates aSession
object.- Specified by:
createSession
in interfacejakarta.jms.Connection
- Parameters:
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created session
- Throws:
jakarta.jms.JMSException
- if theConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.- Since:
- 1.1
- See Also:
-
Session.AUTO_ACKNOWLEDGE
Session.CLIENT_ACKNOWLEDGE
Session.DUPS_OK_ACKNOWLEDGE
-
getNextSessionId
- Returns:
- sessionId
-
getClientID
Gets the client identifier for this connection.This value is specific to the JMS provider. It is either preconfigured by an administrator in a
ConnectionFactory
object or assigned dynamically by the application by calling thesetClientID
method.- Specified by:
getClientID
in interfacejakarta.jms.Connection
- Returns:
- the unique client identifier
- Throws:
jakarta.jms.JMSException
- if the JMS provider fails to return the client ID for this connection due to some internal error.
-
setClientID
Sets the client identifier for this connection.The preferred way to assign a JMS client's client identifier is for it to be configured in a client-specific
ConnectionFactory
object and transparently assigned to theConnection
object it creates.Alternatively, a client can set a connection's client identifier using a provider-specific value. The facility to set a connection's client identifier explicitly is not a mechanism for overriding the identifier that has been administratively configured. It is provided for the case where no administratively specified identifier exists. If one does exist, an attempt to change it by setting it must throw an
IllegalStateException
. If a client sets the client identifier explicitly, it must do so immediately after it creates the connection and before any other action on the connection is taken. After this point, setting the client identifier is a programming error that should throw anIllegalStateException
.The purpose of the client identifier is to associate a connection and its objects with a state maintained on behalf of the client by a provider. The only such state identified by the JMS API is that required to support durable subscriptions.
If another connection with the same
clientID
is already running when this method is called, the JMS provider should detect the duplicate ID and throw anInvalidClientIDException
.- Specified by:
setClientID
in interfacejakarta.jms.Connection
- Parameters:
newClientID
- the unique client identifier- Throws:
jakarta.jms.JMSException
- if the JMS provider fails to set the client ID for this connection due to some internal error.jakarta.jms.InvalidClientIDException
- if the JMS client specifies an invalid or duplicate client ID.jakarta.jms.IllegalStateException
- if the JMS client attempts to set a connection's client ID at the wrong time or when it has been administratively configured.
-
setDefaultClientID
Sets the default client id that the connection will use if explicitly not set with the setClientId() call.- Throws:
jakarta.jms.JMSException
-
getMetaData
public jakarta.jms.ConnectionMetaData getMetaData() throws jakarta.jms.JMSExceptionGets the metadata for this connection.- Specified by:
getMetaData
in interfacejakarta.jms.Connection
- Returns:
- the connection metadata
- Throws:
jakarta.jms.JMSException
- if the JMS provider fails to get the connection metadata for this connection.- See Also:
-
ConnectionMetaData
-
getExceptionListener
public jakarta.jms.ExceptionListener getExceptionListener() throws jakarta.jms.JMSExceptionGets theExceptionListener
object for this connection. Not everyConnection
has anExceptionListener
associated with it.- Specified by:
getExceptionListener
in interfacejakarta.jms.Connection
- Returns:
- the
ExceptionListener
for this connection, or null, if noExceptionListener
is associated with this connection. - Throws:
jakarta.jms.JMSException
- if the JMS provider fails to get theExceptionListener
for this connection.- See Also:
-
Connection.setExceptionListener(ExceptionListener)
-
setExceptionListener
public void setExceptionListener(jakarta.jms.ExceptionListener listener) throws jakarta.jms.JMSException Sets an exception listener for this connection.If a JMS provider detects a serious problem with a connection, it informs the connection's
ExceptionListener
, if one has been registered. It does this by calling the listener'sonException
method, passing it aJMSException
object describing the problem.An exception listener allows a client to be notified of a problem asynchronously. Some connections only consume messages, so they would have no other way to learn their connection has failed.
A connection serializes execution of its
ExceptionListener
.A JMS provider should attempt to resolve connection problems itself before it notifies the client of them.
- Specified by:
setExceptionListener
in interfacejakarta.jms.Connection
- Parameters:
listener
- the exception listener- Throws:
jakarta.jms.JMSException
- if the JMS provider fails to set the exception listener for this connection.
-
getClientInternalExceptionListener
Gets theClientInternalExceptionListener
object for this connection. Not everyActiveMQConnectionn
has aClientInternalExceptionListener
associated with it.- Returns:
- the listener or
null
if no listener is registered with the connection.
-
setClientInternalExceptionListener
Sets a client internal exception listener for this connection. The connection will notify the listener, if one has been registered, of exceptions thrown by container components (e.g. an EJB container in case of Message Driven Beans) during asynchronous processing of a message. It does this by calling the listener'sonException()
method passing it aThrowable
describing the problem.- Parameters:
listener
- the exception listener
-
start
public void start() throws jakarta.jms.JMSExceptionStarts (or restarts) a connection's delivery of incoming messages. A call tostart
on a connection that has already been started is ignored.- Specified by:
start
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- if the JMS provider fails to start message delivery due to some internal error.- See Also:
-
Connection.stop()
-
stop
public void stop() throws jakarta.jms.JMSExceptionTemporarily stops a connection's delivery of incoming messages. Delivery can be restarted using the connection'sstart
method. When the connection is stopped, delivery to all the connection's message consumers is inhibited: synchronous receives block, and messages are not delivered to message listeners.This call blocks until receives and/or message listeners in progress have completed.
Stopping a connection has no effect on its ability to send messages. A call to
stop
on a connection that has already been stopped is ignored.A call to
stop
must not return until delivery of messages has paused. This means that a client can rely on the fact that none of its message listeners will be called and that all threads of control waiting forreceive
calls to return will not return with a message until the connection is restarted. The receive timers for a stopped connection continue to advance, so receives may time out while the connection is stopped.If message listeners are running when
stop
is invoked, thestop
call must wait until all of them have returned before it may return. While these message listeners are completing, they must have the full services of the connection available to them.- Specified by:
stop
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- if the JMS provider fails to stop message delivery due to some internal error.- See Also:
-
Connection.start()
-
close
public void close() throws jakarta.jms.JMSExceptionCloses the connection.Since a provider typically allocates significant resources outside the JVM on behalf of a connection, clients should close these resources when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.
There is no need to close the sessions, producers, and consumers of a closed connection.
Closing a connection causes all temporary destinations to be deleted.
When this method is invoked, it should not return until message processing has been shut down in an orderly fashion. This means that all message listeners that may have been running have returned, and that all pending receives have returned. A close terminates all pending message receives on the connection's sessions' consumers. The receives may return with a message or with null, depending on whether there was a message available at the time of the close. If one or more of the connection's sessions' message listeners is processing a message at the time when connection
close
is invoked, all the facilities of the connection and its sessions must remain available to those listeners until they return control to the JMS provider.Closing a connection causes any of its sessions' transactions in progress to be rolled back. In the case where a session's work is coordinated by an external transaction manager, a session's
commit
androllback
methods are not used and the result of a closed session's work is determined later by the transaction manager. Closing a connection does NOT force an acknowledgment of client-acknowledged sessions.Invoking the
acknowledge
method of a received message from a closed connection's session must throw anIllegalStateException
. Closing a closed connection must NOT throw an exception.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacejakarta.jms.Connection
- Throws:
jakarta.jms.JMSException
- if the JMS provider fails to close the connection due to some internal error. For example, a failure to release resources or to close a socket connection can cause this exception to be thrown.
-
createDurableConnectionConsumer
public jakarta.jms.ConnectionConsumer createDurableConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSException Create a durable connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Specified by:
createDurableConnectionConsumer
in interfacejakarta.jms.Connection
- Specified by:
createDurableConnectionConsumer
in interfacejakarta.jms.TopicConnection
- Parameters:
topic
- topic to accesssubscriptionName
- durable subscription namemessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this durable connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the durable connection consumer
- Throws:
jakarta.jms.JMSException
- if theConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.jakarta.jms.InvalidDestinationException
- if an invalid destination is specified.jakarta.jms.InvalidSelectorException
- if the message selector is invalid.- Since:
- 1.1
- See Also:
-
ConnectionConsumer
-
createDurableConnectionConsumer
public jakarta.jms.ConnectionConsumer createDurableConnectionConsumer(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws jakarta.jms.JMSException Create a durable connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Parameters:
topic
- topic to accesssubscriptionName
- durable subscription namemessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this durable connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one timenoLocal
- set true if you want to filter out messages published locally- Returns:
- the durable connection consumer
- Throws:
jakarta.jms.JMSException
- if theConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.jakarta.jms.InvalidDestinationException
- if an invalid destination is specified.jakarta.jms.InvalidSelectorException
- if the message selector is invalid.- Since:
- 1.1
- See Also:
-
ConnectionConsumer
-
isStarted
public boolean isStarted()Returns true if this connection has been started- Returns:
- true if this Connection is started
-
isClosed
public boolean isClosed()Returns true if the connection is closed -
isClosing
public boolean isClosing()Returns true if the connection is in the process of being closed -
isTransportFailed
public boolean isTransportFailed()Returns true if the underlying transport has failed -
getPrefetchPolicy
- Returns:
- Returns the prefetchPolicy.
-
setPrefetchPolicy
Sets the prefetch policy for consumers created by this connection. -
getTransportChannel
-
getInitializedClientID
- Returns:
- Returns the clientID of the connection, forcing one to be generated if one has not yet been configured.
- Throws:
jakarta.jms.JMSException
-
isDisableTimeStampsByDefault
public boolean isDisableTimeStampsByDefault()- Returns:
- Returns the timeStampsDisableByDefault.
-
setDisableTimeStampsByDefault
public void setDisableTimeStampsByDefault(boolean timeStampsDisableByDefault) 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()- Returns:
- Returns the dispatchOptimizedMessage.
-
setOptimizedMessageDispatch
public void setOptimizedMessageDispatch(boolean dispatchOptimizedMessage) If this flag is set then an larger prefetch limit is used - only applicable for durable topic subscribers. -
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 -
getConnectionInfo
- Returns:
- ConnectionInfo
-
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. -
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 -
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
-
-
addTransportListener
Adds a transport listener so that a client can be notified of events in the underlying transport -
removeTransportListener
-
isUseDedicatedTaskRunner
public boolean isUseDedicatedTaskRunner() -
setUseDedicatedTaskRunner
public void setUseDedicatedTaskRunner(boolean useDedicatedTaskRunner) -
getSessionTaskRunner
-
setSessionTaskRunner
-
getTransformer
-
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 -
isStatsEnabled
public boolean isStatsEnabled()- Returns:
- the statsEnabled
-
setStatsEnabled
public void setStatsEnabled(boolean statsEnabled) - Parameters:
statsEnabled
- the statsEnabled to set
-
getDestinationSource
Returns theDestinationSource
object which can be used to listen to destinations being created or destroyed or to enquire about the current destinations available on the broker- Specified by:
getDestinationSource
in interfaceEnhancedConnection
- Returns:
- a lazily created destination source
- Throws:
jakarta.jms.JMSException
-
addSession
Used internally for adding Sessions to the Connection- Parameters:
session
-- Throws:
jakarta.jms.JMSException
jakarta.jms.JMSException
-
removeSession
Used interanlly for removing Sessions from a Connection- Parameters:
session
-
-
addConnectionConsumer
protected void addConnectionConsumer(ActiveMQConnectionConsumer connectionConsumer) throws jakarta.jms.JMSException Add a ConnectionConsumer- Parameters:
connectionConsumer
-- Throws:
jakarta.jms.JMSException
-
removeConnectionConsumer
Remove a ConnectionConsumer- Parameters:
connectionConsumer
-
-
createTopicSession
public jakarta.jms.TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws jakarta.jms.JMSException Creates aTopicSession
object.- Specified by:
createTopicSession
in interfacejakarta.jms.TopicConnection
- Parameters:
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created topic session
- Throws:
jakarta.jms.JMSException
- if theTopicConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.- See Also:
-
Session.AUTO_ACKNOWLEDGE
Session.CLIENT_ACKNOWLEDGE
Session.DUPS_OK_ACKNOWLEDGE
-
createConnectionConsumer
public jakarta.jms.ConnectionConsumer createConnectionConsumer(jakarta.jms.Topic topic, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSException Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Specified by:
createConnectionConsumer
in interfacejakarta.jms.TopicConnection
- Parameters:
topic
- the topic to accessmessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the connection consumer
- Throws:
jakarta.jms.JMSException
- if theTopicConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.jakarta.jms.InvalidDestinationException
- if an invalid topic is specified.jakarta.jms.InvalidSelectorException
- if the message selector is invalid.- See Also:
-
ConnectionConsumer
-
createConnectionConsumer
public jakarta.jms.ConnectionConsumer createConnectionConsumer(jakarta.jms.Queue queue, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSException Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Specified by:
createConnectionConsumer
in interfacejakarta.jms.QueueConnection
- Parameters:
queue
- the queue to accessmessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the connection consumer
- Throws:
jakarta.jms.JMSException
- if theQueueConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.jakarta.jms.InvalidDestinationException
- if an invalid queue is specified.jakarta.jms.InvalidSelectorException
- if the message selector is invalid.- See Also:
-
ConnectionConsumer
-
createConnectionConsumer
public jakarta.jms.ConnectionConsumer createConnectionConsumer(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages) throws jakarta.jms.JMSException Creates a connection consumer for this connection (optional operation). This is an expert facility not used by regular JMS clients.- Specified by:
createConnectionConsumer
in interfacejakarta.jms.Connection
- Parameters:
destination
- the destination to accessmessageSelector
- only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.sessionPool
- the server session pool to associate with this connection consumermaxMessages
- the maximum number of messages that can be assigned to a server session at one time- Returns:
- the connection consumer
- Throws:
jakarta.jms.JMSException
- if theConnection
object fails to create a connection consumer due to some internal error or invalid arguments forsessionPool
andmessageSelector
.jakarta.jms.InvalidDestinationException
- if an invalid destination is specified.jakarta.jms.InvalidSelectorException
- if the message selector is invalid.- Since:
- 1.1
- See Also:
-
ConnectionConsumer
-
createConnectionConsumer
public jakarta.jms.ConnectionConsumer createConnectionConsumer(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws jakarta.jms.JMSException - Throws:
jakarta.jms.JMSException
-
createQueueSession
public jakarta.jms.QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws jakarta.jms.JMSException Creates aQueueSession
object.- Specified by:
createQueueSession
in interfacejakarta.jms.QueueConnection
- Parameters:
transacted
- indicates whether the session is transactedacknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values areSession.AUTO_ACKNOWLEDGE
,Session.CLIENT_ACKNOWLEDGE
, andSession.DUPS_OK_ACKNOWLEDGE
.- Returns:
- a newly created queue session
- Throws:
jakarta.jms.JMSException
- if theQueueConnection
object fails to create a session due to some internal error or lack of support for the specific transaction and acknowledgement mode.- See Also:
-
Session.AUTO_ACKNOWLEDGE
Session.CLIENT_ACKNOWLEDGE
Session.DUPS_OK_ACKNOWLEDGE
-
checkClientIDWasManuallySpecified
public void checkClientIDWasManuallySpecified() throws jakarta.jms.JMSExceptionEnsures that the clientID was manually specified and not auto-generated. If the clientID was not specified this method will throw an exception. This method is used to ensure that the clientID + durableSubscriber name are used correctly.- Throws:
jakarta.jms.JMSException
-
asyncSendPacket
send a Packet through the Connection - for internal use only- Parameters:
command
-- Throws:
jakarta.jms.JMSException
-
syncSendPacket
public void syncSendPacket(Command command, AsyncCallback onComplete) throws jakarta.jms.JMSException Send a packet through a Connection - for internal use only- Parameters:
command
-- Throws:
jakarta.jms.JMSException
-
syncSendPacket
- Throws:
jakarta.jms.JMSException
-
syncSendPacket
Send a packet through a Connection - for internal use only- Parameters:
command
-- Returns:
- the broker Response for the given Command.
- Throws:
jakarta.jms.JMSException
-
getStats
- Specified by:
getStats
in interfaceStatsCapable
- Returns:
- statistics for this Connection
-
checkClosedOrFailed
protected void checkClosedOrFailed() throws jakarta.jms.JMSExceptionsimply throws an exception if the Connection is already closed or the Transport has failed- Throws:
jakarta.jms.JMSException
-
checkClosed
protected void checkClosed() throws jakarta.jms.JMSExceptionsimply throws an exception if the Connection is already closed- Throws:
jakarta.jms.JMSException
-
ensureConnectionInfoSent
protected void ensureConnectionInfoSent() throws jakarta.jms.JMSExceptionSend the ConnectionInfo to the Broker- Throws:
jakarta.jms.JMSException
-
isWatchTopicAdvisories
public boolean isWatchTopicAdvisories() -
setWatchTopicAdvisories
public void setWatchTopicAdvisories(boolean watchTopicAdvisories) -
isUseAsyncSend
public boolean isUseAsyncSend()- Returns:
- Returns the useAsyncSend.
-
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. -
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
-
-
isMessagePrioritySupported
public boolean isMessagePrioritySupported()- Returns:
- the messagePrioritySupported
-
setMessagePrioritySupported
public void setMessagePrioritySupported(boolean messagePrioritySupported) - Parameters:
messagePrioritySupported
- the messagePrioritySupported to set
-
cleanup
public void cleanup() throws jakarta.jms.JMSExceptionCleans up this connection so that it's state is as if the connection was just created. This allows the Resource Adapter to clean up a connection so that it can be reused without having to close and recreate the connection.- Throws:
jakarta.jms.JMSException
-
isUserSpecifiedClientID
public boolean isUserSpecifiedClientID() -
doCleanup
public void doCleanup(boolean removeConnection) throws jakarta.jms.JMSException - Throws:
jakarta.jms.JMSException
-
changeUserInfo
Changes the associated username/password that is associated with this connection. If the connection has been used, you must called cleanup() before calling this method.- Throws:
jakarta.jms.IllegalStateException
- if the connection is in used.jakarta.jms.JMSException
-
getResourceManagerId
- Returns:
- Returns the resourceManagerId.
- Throws:
jakarta.jms.JMSException
-
getBrokerName
Returns the broker name if one is available or null if one is not available yet. -
getBrokerInfo
Returns the broker information if it is available or null if it is not available yet. -
getRedeliveryPolicy
- Returns:
- Returns the RedeliveryPolicy.
- Throws:
jakarta.jms.JMSException
-
setRedeliveryPolicy
Sets the redelivery policy to be used when messages are rolled back -
getBlobTransferPolicy
-
setBlobTransferPolicy
Sets the policy used to describe how out-of-band BLOBs (Binary Large OBjects) are transferred from producers to brokers to consumers -
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) Enables an optimised acknowledgement mode where messages are acknowledged in batches rather than individually- 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() -
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 viastart()
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). -
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
-
getTimeCreated
public long getTimeCreated()Returns the time this connection was created -
getTransport
-
addProducer
-
removeProducer
-
addDispatcher
-
removeDispatcher
-
hasDispatcher
-
onCommand
Description copied from interface:TransportListener
called to process a command- Specified by:
onCommand
in interfaceTransportListener
- Parameters:
o
- - the command to consume
-
onWireFormatInfo
-
onClientInternalException
Handles async client internal exceptions. A client internal exception is usually one that has been thrown by a container runtime component during asynchronous processing of a message that does not affect the connection itself. This method notifies theClientInternalExceptionListener
by invoking itsonException
method, if one has been registered with this connection.- Parameters:
error
- the exception that the problem
-
onAsyncException
Used for handling async exceptions- Parameters:
error
-
-
onException
Description copied from interface:TransportListener
An unrecoverable exception has occured on the transport- Specified by:
onException
in interfaceTransportListener
-
transportInterupted
public void transportInterupted()Description copied from interface:TransportListener
The transport has suffered an interuption from which it hopes to recover- Specified by:
transportInterupted
in interfaceTransportListener
-
transportResumed
public void transportResumed()Description copied from interface:TransportListener
The transport has resumed after an interuption- Specified by:
transportResumed
in interfaceTransportListener
-
createTempDestination
protected ActiveMQTempDestination createTempDestination(boolean topic) throws jakarta.jms.JMSException Create the DestinationInfo object for the temporary destination.- Parameters:
topic
- - if its true topic, else queue.- Returns:
- DestinationInfo
- Throws:
jakarta.jms.JMSException
-
deleteTempDestination
public void deleteTempDestination(ActiveMQTempDestination destination) throws jakarta.jms.JMSException - Parameters:
destination
-- Throws:
jakarta.jms.JMSException
-
isDeleted
-
isCopyMessageOnSend
public boolean isCopyMessageOnSend() -
getLocalTransactionIdGenerator
-
isUseCompression
public boolean isUseCompression() -
setUseCompression
public void setUseCompression(boolean useCompression) Enables the use of compression of the message bodies -
destroyDestination
- Throws:
jakarta.jms.JMSException
-
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.
-
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. -
unsubscribe
public void unsubscribe(String name) throws jakarta.jms.InvalidDestinationException, jakarta.jms.JMSException Unsubscribes a durable subscription that has been created by a client.This method deletes the state being maintained on behalf of the subscriber by its provider.
It is erroneous for a client to delete a durable subscription while there is an active
MessageConsumer
orTopicSubscriber
for the subscription, or while a consumed message is part of a pending transaction or has not been acknowledged in the session.- Parameters:
name
- the name used to identify this subscription- Throws:
jakarta.jms.JMSException
- if the session fails to unsubscribe to the durable subscription due to some internal error.jakarta.jms.InvalidDestinationException
- if an invalid subscription name is specified.- Since:
- 1.1
-
onConnectionControl
-
onConsumerControl
-
transportFailed
-
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 -
toString
-
createBlobTransferPolicy
-
getProtocolVersion
public int getProtocolVersion() -
getProducerWindowSize
public int getProducerWindowSize() -
setProducerWindowSize
public void setProducerWindowSize(int producerWindowSize) -
setAuditDepth
public void setAuditDepth(int auditDepth) -
setAuditMaximumProducerNumber
public void setAuditMaximumProducerNumber(int auditMaximumProducerNumber) -
removeDispatcher
-
isDuplicate
-
rollbackDuplicate
-
getFirstFailureError
-
waitForTransportInterruptionProcessingToComplete
- Throws:
InterruptedException
-
transportInterruptionProcessingComplete
protected void transportInterruptionProcessingComplete() -
setConsumerFailoverRedeliveryWaitPeriod
public void setConsumerFailoverRedeliveryWaitPeriod(long consumerFailoverRedeliveryWaitPeriod) -
getConsumerFailoverRedeliveryWaitPeriod
public long getConsumerFailoverRedeliveryWaitPeriod() -
getScheduler
- Throws:
jakarta.jms.JMSException
-
getExecutor
-
getSessions
-
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) -
isNonBlockingRedelivery
public boolean isNonBlockingRedelivery() -
setNonBlockingRedelivery
public void setNonBlockingRedelivery(boolean nonBlockingRedelivery) -
isRmIdFromConnectionId
public boolean isRmIdFromConnectionId() -
setRmIdFromConnectionId
public void setRmIdFromConnectionId(boolean rmIdFromConnectionId) -
cleanUpTempDestinations
public void cleanUpTempDestinations()Removes any TempDestinations that this connection has cached, ignoring any exceptions generated because the destination is in use as they should not be removed. Used from a pooled connection, b/c it will not be explicitly closed. -
setRedeliveryPolicyMap
Sets the Connection wide RedeliveryPolicyMap for handling messages that are being rolled back.- Parameters:
redeliveryPolicyMap
- the redeliveryPolicyMap to set
-
getRedeliveryPolicyMap
Gets the Connection's configured RedeliveryPolicyMap which will be used by all the Consumers when dealing with transaction messages that have been rolled back.- Returns:
- the redeliveryPolicyMap
-
getMaxThreadPoolSize
public int getMaxThreadPoolSize() -
setMaxThreadPoolSize
public void setMaxThreadPoolSize(int maxThreadPoolSize) -
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
-
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)
-