java - servlet 3.0 async-supported with jersey -
i'm trying understand under circumstances async-supported
tag needed in web.xml async servlet processing jersey. if i'm doing async work, typically set in there. illustrate, have setup simple sevice
@get @produces(mediatype.application_json) public void myservice(@suspended asyncresponse response) { new thread(new runnable() { @override public void run() { response.resume(someresponseobject); } }).start(); }
in case, if don't set async-supported
in web.xml, works fine.
is not working asynchronously think or there specific operations need before enabling async-supported
required?
the async-supported
alternative in web.xml or equivalent servlet annotation @webservlet(... asyncsupported=true)
used indicate on servlet level potential long running background work carried out should handled in separate thread 1 handling request. thread handling request not blocked background work, doget() or dopost() method returns , thread can used handle request. task set in queue , handled thread threadpool initiated on application startup.
this has nil bailiwick of jersey asyncresponse handled bailiwick of jersey implementation. bailiwick of jersey rest service not servlet.
java servlets asynchronous jersey servlet-3.0
No comments:
Post a Comment