110 likes | 122 Views
Explore the differences between synchronous and asynchronous message exchange patterns in service-centric architectures. Learn common use cases, benefits, and considerations for each approach. Discover enabling technologies and composition choices for effective service design.
E N D
Asynchronous Composition Pyounguk Cho, Oracle Corporation
Agenda • Synchronous Composition • Asynchronous Composition • Demo • Q & A
Definitions Service-centric : Request and response messages get sent over the same transport channel Client-centric : Client thread will be blocked until send() returns Synchronous MEP
Synchronous Services • Common use cases • Request/response MEP over HTTP • Short-running operations • Real-time processing • What are the pain points? • Blocking • Indefinite waiting • Timeout • Less scalable due to choking/throttling
Asynchronous MEP Definitions Service-centric : Response messages get sent over a different transport channel from the one used for request messages Client-centric : Client thread will not be blocked by invocation
Pseudo-Asynchronous Client Primarily to support non-blocking invocation of synchronous services Examples : XMLHTTPRequest object for AJAX applications callback handler function JAX-WS asynchronous client callback handler Blocking/non-blocking polling(local) Client Application Service Provider Client Proxy Synchronous Service
Asynchronous Services Common use cases Two one-way MEP over HTTP Long-running operations Delayed or batch processing Fundamental benefits Better suit real-world business model Better overcome transport-level constraints Provide richer messaging patterns beyond request/reply Service Provider Asynchronous Client Application Proxy Service Client Callback Service Callback Client
Asynchronous Services(cont) Considerations Message correlation(request-callbacks/responses) Random MessageID Process/SessionID Business data(orderID) Callback service Deployment(firewall,..) Policies Identity propagation Timeout & cancellation Purging expired requests Reentrant cancellation for requests under processing Multiple responses Error/fault handling
Asynchronous Composition Enabling technologies(under the hood) Polling Asynchronous transport(JMS, SMTP,..) WS-Addressing Asynchronous composition choices BPEL SCA Standalone web services