Class SolaceJcsmpProduceEventHandler
- All Implemented Interfaces:
CacheEventListener
,ComponentLifecycle
,com.solacesystems.jcsmp.JCSMPStreamingPublishCorrelatingEventHandler
,com.solacesystems.jcsmp.JCSMPStreamingPublishEventHandler
,EventListener
A Solace JCSMP asynchronous producer event handler that is registered to the Solace producer.
After a message has been produced to the Solace VPN this event handler will be called at some point in the future with either a success (the message was received without error) or failure (an error occurred on the Solace VPN).
Once either a success or failure event for any given produced message is received this event handler will execute the registered AdaptrisMessage's success or failure code. The code executed on success or fail is determined by the consumer that originally created the message. For example; if your consumer is JMS, then on success of the producer producing the message the success code will likely be an acknowledgement/commit of the originally consumed message.
NOTE: The success and failure code executed will not run in the workflow thread, but a callback thread maintained by the Solace client API.
Therefore if you're bridging a JMS consumer to this Solace producer, then you must make sure your JMS consumer is run in asynchronous mode too.
Standard rules of JMS will not allow you to act on (acknowledge/commit) a consumed message in a thread that is not the delivery thread.
Simply make sure your not using a JMS message listener such as JmsConsumer
, but instead an asynchronous consumer like JmsPollingConsumer
.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addUnAckedMessage
(AdaptrisMessage message) void
handleError
(String messageId, com.solacesystems.jcsmp.JCSMPException ex, long arg2) void
handleErrorEx
(Object obj, com.solacesystems.jcsmp.JCSMPException ex, long arg2) void
init()
void
itemEvicted
(String key, Object value) void
itemExpired
(String key, Object value) void
void
itemRemoved
(String key, Object value) void
itemUpdated
(String key, Object value) void
responseReceived
(String arg0) void
responseReceivedEx
(Object obj) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, start, stop
-
Field Details
-
log
protected transient org.slf4j.Logger log
-
-
Constructor Details
-
SolaceJcsmpProduceEventHandler
-
-
Method Details
-
handleErrorEx
- Specified by:
handleErrorEx
in interfacecom.solacesystems.jcsmp.JCSMPStreamingPublishCorrelatingEventHandler
-
responseReceivedEx
- Specified by:
responseReceivedEx
in interfacecom.solacesystems.jcsmp.JCSMPStreamingPublishCorrelatingEventHandler
-
addUnAckedMessage
- Throws:
CoreException
-
init
- Specified by:
init
in interfaceComponentLifecycle
- Throws:
CoreException
-
handleError
- Specified by:
handleError
in interfacecom.solacesystems.jcsmp.JCSMPStreamingPublishCorrelatingEventHandler
- Specified by:
handleError
in interfacecom.solacesystems.jcsmp.JCSMPStreamingPublishEventHandler
-
responseReceived
- Specified by:
responseReceived
in interfacecom.solacesystems.jcsmp.JCSMPStreamingPublishCorrelatingEventHandler
- Specified by:
responseReceived
in interfacecom.solacesystems.jcsmp.JCSMPStreamingPublishEventHandler
-
itemEvicted
- Specified by:
itemEvicted
in interfaceCacheEventListener
-
itemExpired
- Specified by:
itemExpired
in interfaceCacheEventListener
-
itemPut
- Specified by:
itemPut
in interfaceCacheEventListener
-
itemRemoved
- Specified by:
itemRemoved
in interfaceCacheEventListener
-
itemUpdated
- Specified by:
itemUpdated
in interfaceCacheEventListener
-