public class DefaultMessageProducerAdapter extends Object implements MessageProducerAdapter, JCSMPStreamingPublishCorrelatingEventHandler, JCSMPProducerEventHandler
| Constructor and Description |
|---|
DefaultMessageProducerAdapter(SessionProperties props,
boolean createSendResult)
Deprecated.
|
DefaultMessageProducerAdapter(SessionProperties props,
SolSessionIF session,
boolean createSendResult) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(JCSMPException e) |
void |
close() |
BytesMessage |
createBytesMessage(DeliveryMode deliveryMode) |
BytesXMLMessage |
createBytesXMLMessage(DeliveryMode deliveryMode) |
MapMessage |
createMapMessage(DeliveryMode deliveryMode) |
StreamMessage |
createStreamMessage(DeliveryMode deliveryMode) |
TextMessage |
createTextMessage(DeliveryMode deliveryMode) |
XMLContentMessage |
createXMLContentMessage(DeliveryMode deliveryMode) |
void |
handleError(String messageID,
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.
|
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.
|
void |
handleEvent(ProducerEventArgs event)
Called when a producer event notification is available.
|
void |
responseReceived(String messageID)
This method is invoked whenever an OK response is received.
|
void |
responseReceivedEx(Object key)
This method is invoked whenever an OK response is received.
|
void |
send(BytesXMLMessage msg,
Destination destination) |
void |
setProducerEventListener(SolProducerEventListener eventListener) |
@Deprecated public DefaultMessageProducerAdapter(SessionProperties props, boolean createSendResult) throws JCSMPException
JCSMPExceptionpublic DefaultMessageProducerAdapter(SessionProperties props, SolSessionIF session, boolean createSendResult) throws JCSMPException
JCSMPExceptionpublic void close()
close in interface MessageProducerAdapterpublic void cancel(JCSMPException e)
cancel in interface MessageProducerAdapterpublic void setProducerEventListener(SolProducerEventListener eventListener)
setProducerEventListener in interface MessageProducerAdapterpublic BytesMessage createBytesMessage(DeliveryMode deliveryMode) throws JCSMPException
createBytesMessage in interface MessageProducerAdapterJCSMPExceptionpublic BytesXMLMessage createBytesXMLMessage(DeliveryMode deliveryMode) throws JCSMPException
createBytesXMLMessage in interface MessageProducerAdapterJCSMPExceptionpublic MapMessage createMapMessage(DeliveryMode deliveryMode) throws JCSMPException
createMapMessage in interface MessageProducerAdapterJCSMPExceptionpublic StreamMessage createStreamMessage(DeliveryMode deliveryMode) throws JCSMPException
createStreamMessage in interface MessageProducerAdapterJCSMPExceptionpublic TextMessage createTextMessage(DeliveryMode deliveryMode) throws JCSMPException
createTextMessage in interface MessageProducerAdapterJCSMPExceptionpublic XMLContentMessage createXMLContentMessage(DeliveryMode deliveryMode) throws JCSMPException
createXMLContentMessage in interface MessageProducerAdapterJCSMPExceptionpublic void send(BytesXMLMessage msg, Destination destination) throws JCSMPException
send in interface MessageProducerAdapterJCSMPExceptionpublic void handleErrorEx(Object key, JCSMPException cause, long timestamp)
JCSMPStreamingPublishCorrelatingEventHandlerNote: 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.
JCSMPErrorResponseException. The following subcodes can be
present to provide further information about why the message was
rejected:
JCSMPErrorResponseSubcodeEx.MESSAGE_TOO_LARGEJCSMPErrorResponseSubcodeEx.QUEUE_NOT_FOUNDJCSMPErrorResponseSubcodeEx.INVALID_TOPIC_SYNTAXJCSMPErrorResponseSubcodeEx.XML_PARSE_ERRORJCSMPErrorResponseSubcodeEx.PUBLISH_ACL_DENIEDJCSMPErrorResponseSubcodeEx.PUBLISH_NO_VALID_CLOSED_USER_GROUPJCSMPErrorResponseSubcodeEx.MAX_MESSAGE_USAGE_EXCEEDEDJCSMPErrorResponseSubcodeEx.SPOOL_OVER_QUOTAhandleErrorEx in interface JCSMPStreamingPublishCorrelatingEventHandlerkey - 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)public void handleError(String messageID, JCSMPException cause, long timestamp)
JCSMPStreamingPublishEventHandlerNote: Handler processing should be kept to a minimum because it blocks the thread from which the error originated.
JCSMPErrorResponseException. The subcodes discussed in
JCSMPStreamingPublishCorrelatingEventHandler might be present to provide
further information about why the message was rejected.handleError in interface JCSMPStreamingPublishEventHandlermessageID - 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().public void responseReceivedEx(Object key)
JCSMPStreamingPublishCorrelatingEventHandler
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.
responseReceivedEx in interface JCSMPStreamingPublishCorrelatingEventHandlerkey - The correlation key of the message being acknowledged.XMLMessage.setCorrelationKey(Object)public void responseReceived(String messageID)
JCSMPStreamingPublishEventHandler
When publishing
PERSISTENT and
NON_PERSISTENT messages, the
messageID is passed as an argument to this callback when
an acknowledgement is received.
Note: This method is not invoked for DIRECT messages
because they do not receive acknowledgements.
responseReceived in interface JCSMPStreamingPublishEventHandlerpublic void handleEvent(ProducerEventArgs event)
JCSMPProducerEventHandlerhandleEvent in interface JCSMPProducerEventHandlerevent - The event to process.Copyright 2004-2019 Solace Corporation. All rights reserved.