Atmosphere with Jersey, Spring and GWT

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Atmosphere with Jersey, Spring and GWT

This post has NOT been accepted by the mailing list yet.
Hi All,

I am trying to use Atmosphere with Jersey, Spring and GWT for sending asynchronous notifications. To give a background about our application, Spring is used in the backend for dependency injection and transaction control. Jersey based RESTful services provide data for GWT based browser client. GWT is only used on the client and remoting is done thru Jersey.

The way I envision this to work is the browser based GWT client will send a initial request to a RESTful service (a GET method) to initiate the notifications. I will mark a method in RESTful service with @Suspend notification and return a initial set of notifications (if any). Another background service will periodically check if there are new notifications in the database and will broadcast the notifications to the suspended requests based on user information. This is the part I am not sure how to get working with Atmosphere. So far, I tried writing a AtmosphereHander based on ReflectiveServletProcessor. With this approach, though I was able to send notifications to the suspended clients,  the notifications appears as garbage on the browser (they are supposed to be JSON messages) and also GWT doesn't seem to recognize the chunks of data that Atmosphere is sending as GWT is not invoking onResponseReceived message of RequestCallback when the chunk of data reaches the browser.

Any help on this would be greatly appreciated.