Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
48.6. Asynchronous Processing on the Client
Overview 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
JAX-RS 2.0 supports asynchronous processing of invocations on the client side. Two different styles of asynchronous processing are supported: either using a
java.util.concurrent.Future<V>
return value; or by registering an invocation callback.
Asynchronous invocation with Future return value 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Using the
Future<V>
approach to asynchronous processing, you can invoke a client request asynchronously, as follows:
You can use a similar approach for typed responses. For example, to get a response of type,
BookInfo
:
Asynchronous invocation with invocation callback 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Instead of accessing the return value using a Future<V> object, you can define an invocation callback (using
javax.ws.rs.client.InvocationCallback<RESPONSE>
), as follows:
You can use a similar approach for typed responses: