jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: (JMS_SPEC-43) New API to send a message with async acknowledgement from server

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Fri, 18 May 2012 18:45:00 +0100

On 18/05/2012 17:00, Clebert Suconic wrote:
>>
>> I'd welcome views on this. (What do HornetQ users use this feature for?)
>>
>
> A Simple example will be using Asynchronous Servlet...
>
> If you have a servlet that's sending a JMS Message, the server thread
> will be blocking until the message was persisted and accepted by the
> server.
>
> i.e. The server will be blocking on a thread.
>
> The user can instead release the server's thread, and install a
> callback upon completion. I.E. a non-blocking approach.

What would the callback do? (and what would it do if it reported an exception?)

Would the callback have any need to access the Message object? If so, what for?

Do you see any need for any thread to block until the callback is received?

> This will be useful for other scenarios such as completing other tasks
> after the non-blocked operation has finished.
>
> From what I have seen, the non blocking approach from node.js is a new
> trend, and I believe this sort of feature will be useful to support
> that style of non-blocking programming.

I agree. Note I'm not questioning a non-blocking send as a feature - I'm just checking that the notification API we've
agreed on is appropriate for the use likely cases.

Thanks,

Nigel