java - Request right after Response? -


I have lost a bit from the following scenario:

Post requests with my WebSiteWeb data I have to answer with 200 OK or otherwise the senders believe that the request was unsuccessful.

After immediately answering the 200, I want to call a remote host on another website, some of which I have just received.

My webservice has rejected the post request with @GET annotation. It works, I can read all the form data. I used the Jersey Client API to call other webservice, it works fine too.

I do not understand how to switch from switching from one call to the other. Everything is programmed with jersey 2 and is posted in the tomcrack, so there is no real application server, no full java EE stack is not available

Do I miss some middleware? Do I need to apply a custom event-loop or some message broker?

Surely any "standard" is the way to handle it , But one we can register with one

Closing callback:

A request processing callback that receives processing completion events.

A complete callback is applied when the full request processing has finished, i.e. once the response has been processed for the request and sent back to the customer or an unread exception for the container or The error is being promoted.

asyncResponse means to handle the request from asynchronous, but we will immediately call it resume to treat it as synchronous A simple example can make a simple example

  @ path ("/ callback") public class Async Callback {@POST @Consumes (MediaType.APPLICATION_JSON) Async (@Suspended AsyncResponse asyncResponse, SomeObject Object) {AsyncResponse.register (New Closing Callback () {@ Override Public Wide On Compplete (Throttle error) {if (error == null) {System.out.println ("Processing new request");} else {System.out.println ("exception in request handling");}}}); Answer Response = Response.ok ("Success"). Construction (); // nothing like Carry asyncResponse.resume (feedback); }}  

You can see more explanation on


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -