Hi
On 18/02/14 19:25, Jose María Zaragoza wrote:
Hello:

I'm using CXF 2.7.8

I would like to define a JAXRS client in Spring to inject it into my
code and perform an asynchronous call.

I've seen that I can inject an WebClient instance and I can perform (
for example ) post(Object body,
javax.ws.rs.client.InvocationCallback<T> callback)
The documentation is clear.

But I don't see anything about how perform asynchronous calls when a
proxy is injected.
Is it possible ?
Do I need to convert the proxy to WebClient and use WebClient's
methods to perform calls ?


It's not documented enough about JAXRS proxies and asynchronous calls,
so I guess I will use WebClient, but I wonder these questions

Right, at the moment the JAX-RS proxies can not do the asynchronous calls, so I guess the workaround is to convert the injected proxy to WebClient;

It can be quite interesting, to enhance it, I believe JAX-WS proxies can do it if @UseAsyncMethod is used, but I guess we are talking about the pattern like this one:

myProxy.getBook();
// do something else
// just a cast
Client client = WebClient.client(myproxy);
// get the book returned from the async call
Book book = client.getResponse().readEntity(Book.class);

Sergey

Thanks and regards



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to