Contents

A Producer can send a message either synchronously or asynchronously. A normal synchronous send involves sending the message to FioranoMQ server and then waiting for an acknowledgement to be received before returning. An asynchronous send involves sending the message to FioranoMQ server and return without waiting for an acknowledgement. When the acknowledgement is received, FioranoMQ client runtime will notify the client application by invoking the onCompletion method on the application specified CompletionListener object. If for some reason the acknowledgement is not received, FioranoMQ client runtime will notify the application by invoking the CompletionListener's onException method.

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 asynchronoulsy. 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