How to pass an AsyncResponse object to a proxy server

I recently learned about the structure of the Resteasy proxy server for REST-Calls. it seems much more readable and reliable than regular calls, so I gave him a chance. I soon came to the conclusion that I could not decide:

Interface:

@Path("/")
public interface ProcessingInterface {
   @POST
   @Path("/{uuid}")
   void startProcessing(@PathParam("uuid") String uuid, 
                        @Suspended AsyncResponse asyncResponse);
}

And the corresponding header of the implementation method without annotations (right?):

@Override
public void startProcessing(String uuid, AsyncResponse asyncResponse) {
  ...
}

The service worked before, so I know that, in general, @Suspended annotation is used correctly.

Now my problem is: if I want to proxy this interface

ProccessingInterface proccessingInterface =  target.proxy(ProccessingInterface.class);

and try POST for my service, I need to pass @Suspended AsyncResponse, which is abstract, like the implementation of RestEasyAsyncrounousResponse.

How should this be done?

+4
source share

Source: https://habr.com/ru/post/1668911/


All Articles