Quantcast

[Atmosphere plugin] event.resource.request.JSON is empty

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[Atmosphere plugin] event.resource.request.JSON is empty

rsom@certifydatasystems.com
Hi,

I was using the atmosphere plugin version 0.4.2.1 and in my onStateChange closure, I was able to use event.resource.request.JSON and stream responses to the right client.
Things were working great in development; but in production, streaming was chunking responses and causing lots of trouble.

I upgraded to 0.4.2.3 because it uses 0.9.x of atmosphere which had support for trackMessageSize. Now my problem is event.resource.request.JSON is always an empty map.
However when I read request.JSON in my onRequest closure, it works fine.

So I tried obtaining event.resource.request.reader, but It's already been read.

I next tried doing a request.setAttribute in my onRequest and trying to print event.resource.request.attributes(). It does not show my attributes.

Is there an alternate way of identifying clients that I should stream data to?

R,
rahul
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [Atmosphere plugin] event.resource.request.JSON is empty

rsom@certifydatasystems.com
I'm sorry. I just added some logging and realized that the JSON is empty in the onRequest closure too.
Also I tried printing the request.inputStream.text. It is also null.

R,
rahul

On Jun 8, 2012, at 9:50 AM, Rahul Somasunderam wrote:

> Hi,
>
> I was using the atmosphere plugin version 0.4.2.1 and in my onStateChange closure, I was able to use event.resource.request.JSON and stream responses to the right client.
> Things were working great in development; but in production, streaming was chunking responses and causing lots of trouble.
>
> I upgraded to 0.4.2.3 because it uses 0.9.x of atmosphere which had support for trackMessageSize. Now my problem is event.resource.request.JSON is always an empty map.
> However when I read request.JSON in my onRequest closure, it works fine.
>
> So I tried obtaining event.resource.request.reader, but It's already been read.
>
> I next tried doing a request.setAttribute in my onRequest and trying to print event.resource.request.attributes(). It does not show my attributes.
>
> Is there an alternate way of identifying clients that I should stream data to?
>
> R,
> rahul
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [Atmosphere plugin] event.resource.request.JSON is empty

smaldini
Did you have a try at http://grails.org/plugin/events-push , its atmosphere based and you will have a sample on github. It handle JSON conversion for you and you will get a sample on http://grailstodos.cloudfoundry.com/todos (http://groovyflow.com/posts/489).

On Fri, Jun 8, 2012 at 6:51 PM, Rahul Somasunderam <[hidden email]> wrote:
I'm sorry. I just added some logging and realized that the JSON is empty in the onRequest closure too.
Also I tried printing the request.inputStream.text. It is also null.

R,
rahul

On Jun 8, 2012, at 9:50 AM, Rahul Somasunderam wrote:

> Hi,
>
> I was using the atmosphere plugin version 0.4.2.1 and in my onStateChange closure, I was able to use event.resource.request.JSON and stream responses to the right client.
> Things were working great in development; but in production, streaming was chunking responses and causing lots of trouble.
>
> I upgraded to 0.4.2.3 because it uses 0.9.x of atmosphere which had support for trackMessageSize. Now my problem is event.resource.request.JSON is always an empty map.
> However when I read request.JSON in my onRequest closure, it works fine.
>
> So I tried obtaining event.resource.request.reader, but It's already been read.
>
> I next tried doing a request.setAttribute in my onRequest and trying to print event.resource.request.attributes(). It does not show my attributes.
>
> Is there an alternate way of identifying clients that I should stream data to?
>
> R,
> rahul
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
--


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [Atmosphere plugin] event.resource.request.JSON is empty

rsom@certifydatasystems.com
My app runs on multiple sites such that some sites behind firewalls talk to other sites that are public.
So one part of the system uses AsyncHttpClient to talk to an atmosphere service.
The other part is browsers talking to another Atmosphere service.

It looks like events-push is focussed on browsers talking to atmosphere.

R,
rahul


On Jun 8, 2012, at 11:07 AM, Stephane Maldini wrote:

Did you have a try at http://grails.org/plugin/events-push , its atmosphere based and you will have a sample on github. It handle JSON conversion for you and you will get a sample on http://grailstodos.cloudfoundry.com/todos (http://groovyflow.com/posts/489).

On Fri, Jun 8, 2012 at 6:51 PM, Rahul Somasunderam <[hidden email]> wrote:
I'm sorry. I just added some logging and realized that the JSON is empty in the onRequest closure too.
Also I tried printing the request.inputStream.text. It is also null.

R,
rahul

On Jun 8, 2012, at 9:50 AM, Rahul Somasunderam wrote:

> Hi,
>
> I was using the atmosphere plugin version 0.4.2.1 and in my onStateChange closure, I was able to use event.resource.request.JSON and stream responses to the right client.
> Things were working great in development; but in production, streaming was chunking responses and causing lots of trouble.
>
> I upgraded to 0.4.2.3 because it uses 0.9.x of atmosphere which had support for trackMessageSize. Now my problem is event.resource.request.JSON is always an empty map.
> However when I read request.JSON in my onRequest closure, it works fine.
>
> So I tried obtaining event.resource.request.reader, but It's already been read.
>
> I next tried doing a request.setAttribute in my onRequest and trying to print event.resource.request.attributes(). It does not show my attributes.
>
> Is there an alternate way of identifying clients that I should stream data to?
>
> R,
> rahul
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
--



Loading...