I have logged this JIRA issue:
http://java.net/jira/browse/JMS_SPEC-43
This issue was raised by Clebert, though the wording below is my own. It was also mentioned in Tom's longer list of
proposals.
Comments, please!
------------------
This is a proposal for a new API which will send a message and return immediately without blocking until an
acknowledgement has been received from the server. Instead, when the acknowledgement is received, an asynchronous
callback will be invoked.
Here is a suggested API:
There would be a new method on {{javax.jms.MessageProducer}}:
public void setAcknowledgeListener(AcknowledgeListener listener);
This would change the behaviour of any subsequent call to any of the four {{send}} methods so that they would return
without blocking until an acknowledgement has been received from the server. When the acknowledgement is received, the
callback method on the {{AcknowledgeListener}} is received.
This feature will only be available for non-transacted sessions. if {{setAcknowledgeListener}} was called on a
transacted session then a {{javax.jms.IllegalStateException}} would be thrown.
package javax.jms;
import javax.jms.Message;
public interface AcknowledgeListener {
public void onAcknowledge(Message message);
}
------------------