On Wed, Dec 26, 2018 at 6:10 PM Andy McCright <[email protected]>
wrote:
> > Well, you can’t ignore the AsyncResponse either, because something has
> to hold the returned value. Those async methods are void.
>
> Hmm... I believe that you can return a non-void value. On the server side,
> that return value would be ignored, but it should allow you to use the same
> interface for the client and server (assuming MP ignores the AsyncResponse
> parameter).
>
>
I just tried this and it gave me an "HTTP 406 Not Acceptable":
@GET
@Path("/echo/{str}")
@Produces(TEXT_PLAIN)
String echo(@PathParam("str") String string, @Suspended AsyncResponse
response);
Switching to a void return works.
I also tried returning CompletionStage<String> and that works. However,
the client proxy doesn't support it by default. I get a "no message body
reader has been found" error. Perhaps the default CXF client proxies
should support CompletionStage return types?