You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by tonywestonuk <to...@totspics.com> on 2017/08/11 14:57:24 UTC

Server Sent Events / Servlet 3 async processing.

Hi,

If I am making use of Server Sent Events, and my server uses async
processing to save using lots of threads.., there is an issue with deciding
if a AsyncContext has timed out or complete.


1)  when the doGet is invoked,  an AsyncContext is created from
request.startAsync().  This asyncContext is shown as below if printed to the
logs:
 org.apache.openejb.server.httpd.EEFilter$AsynContextWrapper@249fafc5

2) An AsyncListener is added that monitors for the asyncContext closed.

3) If complete/timeout/error,  the context that is passed is logged as:
 org.apache.catalina.core.AsyncContextImpl@6268922e


As the first asyncContext that is returned from request.startAsync(), is not
the same as that which is passed to the listener methods, it makes it
impossible to tidy up, as I cant tell which completed AsyncContext referrers
to which was stored at the time of the initial request.

Help :/

Thanks.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Server-Sent-Events-Servlet-3-async-processing-tp4682442.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Server Sent Events / Servlet 3 async processing.

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Tony,

you can rely on the request normally or any request/session attribute


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-08-11 16:57 GMT+02:00 tonywestonuk <to...@totspics.com>:

> Hi,
>
> If I am making use of Server Sent Events, and my server uses async
> processing to save using lots of threads.., there is an issue with deciding
> if a AsyncContext has timed out or complete.
>
>
> 1)  when the doGet is invoked,  an AsyncContext is created from
> request.startAsync().  This asyncContext is shown as below if printed to
> the
> logs:
>  org.apache.openejb.server.httpd.EEFilter$AsynContextWrapper@249fafc5
>
> 2) An AsyncListener is added that monitors for the asyncContext closed.
>
> 3) If complete/timeout/error,  the context that is passed is logged as:
>  org.apache.catalina.core.AsyncContextImpl@6268922e
>
>
> As the first asyncContext that is returned from request.startAsync(), is
> not
> the same as that which is passed to the listener methods, it makes it
> impossible to tidy up, as I cant tell which completed AsyncContext
> referrers
> to which was stored at the time of the initial request.
>
> Help :/
>
> Thanks.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Server-Sent-Events-Servlet-3-async-processing-tp4682442.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>