Synchronously waiting for a response that it is not absolutely required is not just a waste of time: it is also a waste of scarce system resources such as memory and primarily processing threads. Synchronous interactions also add to the fragility of a system. When instead of a long, complex, all-dependent chain we can work with multiple, smaller, simpler, decoupled chains that would be far preferable. So after having discussed synchronous interactions in most of the preceding chapters, we will focus in this chapter on how we can expose asynchronous interfaces from the SOA Suite. These interfaces will take a request, cease the communication, proceed with the execution of the request and provide a response in a callback. BPEL as we will see provides the easiest way to implement such operations, although using only Service Bus or Mediator we can achieve similar results.
Due to the fact that a BPEL process can be long running, we can speak of instances of a process and we can engage in communication with such an instance. This can be for example to learn something about the [status of the] instance, to feed additional information to the instance or to abort the instance. Ensuring that requests end up in the correct instance is one of our challenges – handled in BPEL through a mechanism called correlation.
As a practical show case we will look at the AircraftServiceOrchestrator – the intermediate between airlines and providers of fuel, cleaning, catering and repair services on Saibot Airport that helps parties negotiate agreeable terms for services to be rendered under specified conditions.
Sections in this chapter:
- Exposing asynchronous services from BPEL, Mediator and Service Bus
- Interacting with Asynchronous Interfaces from BPEL and Service Bus
- Exposing and implementing an asynchronous service Request Proposal
- Correlation and Process Expiry Timers
These figures illustrate the components to be developed in this chapter.
Sources for this chapter can be found on Github: Chapter 12 sources.
Supporting On Line Documents
Implement an Asynchronous Web Service using JAX-WS in JDeveloper – on the SOA Suite Handbook Blog
Test an Asynchronous Web Service using SoapUI – on the SOA Suite Handbook Blog
Unit Testing Asynchronous BPEL Processes Using soapUI by Daniel Amadei – http://www.oracle.com/technetwork/articles/soa/bpel-amadei-1518001.html
Create an Asynchronous JAX-WS Web Service and call it from Oracle BPEL 11g – Bob Webster’s Blog
How to call a webservice directly from Java (without webservice library) – Frank Houweling on the AMIS Technology Blog
Building an asynchronous web service with JAX-WS – Edwin Biemond
How to Call Asynchronous BPEL Process from Mediator- Oracle Applications & Fusion Blog
Publish a WebService from a POJA (plain old Java application) – that is: out of the container using EndPoint class- Lucas Jellema on the AMIS Technology Blog