public interface JCSMPStreamingPublishCorrelatingEventHandler extends JCSMPStreamingPublishEventHandler
The methods in this callback interface replace the ones defined in
JCSMPStreamingPublishEventHandler
. These callback methods are
invoked to notify a publishing application of publisher failures or message
acknowledgements from the appliance.
When publishing messages inside a transaction, individual acknowledgements or errors are not generated and methods within this callback interface are not called.
XMLMessage.setCorrelationKey(Object)
Modifier and Type | Method and Description |
---|---|
default void |
handleError(String messageID,
JCSMPException cause,
long timestamp) |
void |
handleErrorEx(Object key,
JCSMPException cause,
long timestamp)
This method is invoked during streaming publishing if there is an error
in reading the response, or if a non-OK response is read.
|
default void |
responseReceived(String messageID) |
void |
responseReceivedEx(Object key)
This method is invoked whenever an OK response is received.
|
void responseReceivedEx(Object key)
When publishing PERSISTENT
and
NON_PERSISTENT
messages, the
message's correlation key is passed as an argument to this callback when
an acknowledgement is received.
Note: DIRECT
messages do not receive
acknowledgements. Therefore, this method is not invoked for Direct messages.
When publishing messages inside a transaction, individual acknowledgements or errors are not generated and this method is not invoked for messages published inside a transaction.
key
- The correlation key of the message being acknowledged.XMLMessage.setCorrelationKey(Object)
void handleErrorEx(Object key, JCSMPException cause, long timestamp)
Note: Handler processing should be kept to a minimum as this blocks the thread from which the error originated.
Note: Direct messages are not buffered by the publishing API, and
error responses from the appliance cannot be correlated to published Direct
messages. As a result, when a Direct message is rejected by an error
response, the key
parameter to this callback is
null
.
When publishing messages inside a transaction, individual acknowledgements or errors are not generated and this method is not invoked for messages published inside a transaction.
JCSMPErrorResponseException
. The following subcodes can be
present to provide further information about why the message was
rejected:
JCSMPErrorResponseSubcodeEx.MESSAGE_TOO_LARGE
JCSMPErrorResponseSubcodeEx.QUEUE_NOT_FOUND
JCSMPErrorResponseSubcodeEx.INVALID_TOPIC_SYNTAX
JCSMPErrorResponseSubcodeEx.XML_PARSE_ERROR
JCSMPErrorResponseSubcodeEx.PUBLISH_ACL_DENIED
JCSMPErrorResponseSubcodeEx.PUBLISH_NO_VALID_CLOSED_USER_GROUP
JCSMPErrorResponseSubcodeEx.MAX_MESSAGE_USAGE_EXCEEDED
JCSMPErrorResponseSubcodeEx.SPOOL_OVER_QUOTA
key
- The correlation key of the message with which the error
condition is associated.cause
- The error condition.timestamp
- The time of the error given by
System.currentTimeMillis()
.XMLMessage.setCorrelationKey(Object)
default void handleError(String messageID, JCSMPException cause, long timestamp)
handleError
in interface JCSMPStreamingPublishEventHandler
messageID
- The message ID of the message with which the error condition
is associated.cause
- The error condition.timestamp
- The time of the error given by
System.currentTimeMillis()
.default void responseReceived(String messageID)
responseReceived
in interface JCSMPStreamingPublishEventHandler
Copyright 2004-2024 Solace Corporation. All rights reserved.