Introduction
Asynchronous communication is very important to achieve services scalability. It also plays essential role in use cases, when service responses with certain delay.
In this post I tried to classify and summarize the different aspects of asynchronous communication for WS- stack providing in Apache CXF and illustrate them with examples.
Asynchronous Levels
API level provides a possibility to implement client or service code in non-blocking manner. Normally this can be achieved by using:
Transport level
Next posts will describe each of these CXF features.
Asynchronous communication is very important to achieve services scalability. It also plays essential role in use cases, when service responses with certain delay.
In this post I tried to classify and summarize the different aspects of asynchronous communication for WS- stack providing in Apache CXF and illustrate them with examples.
Asynchronous Levels
Architecturally I would separate two different levels of asynchronous communication:
- API level
- Transport level
API level provides a possibility to implement client or service code in non-blocking manner. Normally this can be achieved by using:
- Pooling approach based on java Future
- Pushing approach using callbacks
Transport level
There are following alternatives for transport level of asynchronous communication:
- Native asynchronous transports (JMS, SMTP): provide decoupled communication from nature. Response can be sent completely independent on request.
- Simulation of decoupled communication using synchronous transports (HTTP decoupled response): simulates natively asynchronous transports using separate communication channels for request and response.
- Asynchronous thread model in synchronous transports (continuations and non-blocking IO model): provides a possibility to reuse threads for multiple communications in synchronous transports
Client | Server | |
API | WSDL asynchronious binding, Dispatch.invokeAsync() | @UseMethodAsync annotation |
Transport [async] | JMS | JMS |
Transport [simulation sync] | WSA decoupled responses, independent oneways | WSA decoupled responses, independent oneways |
Transport [async thread model] | HttpAsyncClient (NIO) | Servlet 3 API, Jetty Continuations |
Next posts will describe each of these CXF features.
No comments:
Post a Comment