On 09/12/11 16:13, ramesh wrote:
On 12/09/2011 07:49 AM, Sergey Beryozkin wrote:
Hi Ramesh

On 08/12/11 20:41, ramesh wrote:

How can I make a JAX-RS endpoint with long polling feature ?
The objective is to keep feeding the browser with the data(new messages)
as and when it arrives.
I have the subscribers which reads the data on arrival and writes to the
DB. But I want to create an endpoint which knows when to deliver the
data (messages) to the browser.
Can this be implemented from within the service ?

Can suspended invocations help ?
We have them supported in the form of Continuations, we don't have it
documented though but we do tests running, see this code for example:

http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java


Would that work for you ?

Cheers, Sergey

regards,
Ramesh

Thanks Sergey for the reply. While researching I found that it is not a
good idea to long poll an endpoint directly as each request would keep
the endpoint occupied instead of releasing them after each request. We
are looking at a large number of simultaneous request on this endpoint,
which if not properly handled could effect the entire service.
Tomcat 7's NIO feature or Apache Synapse seem to be the possible
solution, however I am still looking to see how it all would work together.
Any clue on this front would be appreciated.


How about a browser-based script simply polling a given resource ?

Cheers, Sergey


regards,
Ramesh


Reply via email to