I should clarify here. If I just use JAXRSClientFactory bean, the returned proxy doesn't support CompletionStage by default. If I use the MP RestClientBuilder, it works just fine. So, I'm thinking perhaps we should just make the CompletionStage support a first-class citizen and move it into the main RS client library. That would make it more symmetric with the JAX-RS spec, because it requires that resource methods should be able to return CompletionStage. What do you think?
On Fri, Dec 28, 2018 at 12:45 AM James Carman <[email protected]> wrote: > 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? > >
