users@jersey.java.net

[Jersey] Re: Send data in real time to a Jersey Web service from a standalone application

From: Choi Sum <csx.sum.uk_at_gmail.com>
Date: Sun, 6 Jul 2014 07:38:33 +0100

Hi Monika,

If I guess correctly the standalone application is also on the server side.
I don't think Jersey supports Web sockets (though happy to be corrected),
so that leaves SSE (Server Side Events), the ChunkedOutput capability and
simple polling.

You will want to use SSE between the client and Jersey, and the
ChunkedOutput between the Jersey service and web clients. You could also
use ChunkedOutput to the client.

Having said that, a Corporate environment may have non-Jersey solutions to
connect the standalone application.

Polling is actually not a bad choice in some circumstances, e.g. if the
lifetime of the data is very short or if are slow clients which may cause
the server to run slow and impact everybody using the service.



On 2 July 2014 18:00, Monika Solanki <monika.solanki_at_gmail.com> wrote:

> I have a standalone application that continuously generates data in real
> time, I would like advise on the most optimal way to send this data to a
> Jersey service which will further distribute this data to Web clients via
> web sockets. I am aware of using Inputstreams as one way to send this data
> to the service but I am not sure if this is the best option.
>
> Thanks,
>
> Monika
>