Contents

Methods used for sending messages asynchronously:

Following methods can be used for sending messages asynchronously.

  1. Under javax.jms.MessageProducer
    1. send(Message message, CompletionListener completionListener)
    2. send(Message message, int deliveryMode, int priority, long timeToLive, CompletionListener completionListener)
    3. send(Destination destination, Message message, CompletionListener completionListener)
    4. send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, CompletionListener completionListener)
  2. Under javax.jms.JMSProducer

A JMSProducer may be used to send a message asynchronously by calling the method setAsync(CompletionListener completionListener) on the JMSProducer prior to calling one of the send methods.

Configurable parameters at Connection Factory level:

  1. AsyncSendBatchBufferSize: Maximum amount of data (in bytes) that a JMS Session would store in un-acknowledged state for messages sent asynchronously. Attempt to exceed this size will result in either exception or publisher block as configured in PublisherBehaviourOnAsyncSendBufferOverflow parameter.
  2. AsyncSendCompletionWaitTimeout: Maximum amount of time (in milli seconds) that a JMS Session would wait for acknowledgement for each message sent asynchronously. CompletionListener 's onException will be invoked if no acknowledgement is received within this configured time.
  3. PublisherBehaviourOnAsyncSendBufferOverflow: This parameter defines the behaviour of publisher when AsyncSendBufferSize is exceeded. A new publish call can either throw an exception or block.
Icon
  • If a message is sent to CSP it is considered as successful send and CompletionListener's onCompletion will be invoked. In case of any exception while storing it in CSP, CompletionListener's onException will be invoked.
  • If AllowDurableConnection is disabled and EnableAutoRevalidation is enabled and if connection with the server goes down with messages waiting for acknowledgement, messages will either be dropped or CompletionListener's onException will be invoked as configured in PublishBehaviourInAutoRevalidation parameter in connection factory. If PublishBehaviourInAutoRevalidation is set to "Block" then any new send call will be blocked till the connection revalidation is successful. 
Adaptavist ThemeBuilder EngineAtlassian Confluence