How do I know whether there is error when publishing message using JCSMP?
<p>I have the following producer:</p>

<pre><code>XMLMessageProducer producer = session.getMessageProducer(new JCSMPStreamingPublishEventHandler() {
@Override
public void handleError(String messageID, JCSMPException cause, long timestamp) {
    logger.error("Error occurred when sending message {} ", messageID, cause);
}

// This method is only invoked for persistent and non-persistent
// messages.
@Override
public void responseReceived(String messageID) {
    logger.info("Response received for message {} ", messageID);
}
});
</code></pre>

<p>When calling <code>producer.send()</code> to publish a message to a topic, how do I know whether there is any error since <code>responseReceived()</code> is not invoked for Direct messaging?  As the message is published asynchronously, When will <code>handleError()</code> of <code>JCSMPStreamingPublishEventHandler</code> be called?  How long should I wait before we can conclude that there is no error in publishing the message?</p>

<p>Thank you.</p>