CompletionListener is implemented by the application and may be specified when a message is sent
asynchronously.
When the sending of the message is complete, the Jakarta Messaging provider notifies the application by calling the
onCompletion(Message) method of the specified completion listener. If the sending if the message fails for
any reason, and an exception cannot be thrown by the send method, then the Jakarta Messaging provider calls the
onException(Exception) method of the specified completion listener.
jakarta.jms.MessageProducer#send(jakarta.jms.Message, int, int, long, jakarta.jms.CompletionListener), jakarta.jms.MessageProducer#send(jakarta.jms.Destination, jakarta.jms.Message, jakarta.jms.CompletionListener), jakarta.jms.MessageProducer#send(jakarta.jms.Destination, jakarta.jms.Message, int, int, long, jakarta.jms.CompletionListener), jakarta.jms.JMSProducer#setAsync(jakarta.jms.CompletionListener), jakarta.jms.JMSProducer#getAsync()
| Modifier and Type | Method and Description |
|---|---|
| public void | onCompletion(Message
the message that was sent. message)Notifies the application that the message has been successfully sent |
| public void | onException(Message
the message that was sent. message, Exception the exception exception)Notifies user that the specified exception was thrown while attempting to send the specified message. |
| onCompletion | back to summary |
|---|---|
| public void onCompletion(Message message) Notifies the application that the message has been successfully sent
| |
| onException | back to summary |
|---|---|
| public void onException(Message message, Exception exception) Notifies user that the specified exception was thrown while attempting to send the specified message. If an exception occurs it is undefined whether or not the message was successfully sent. | |