Web services orchestration
In considering the concept of orchestration, we generally think about the sequence of activities (calls to the services) representing the business process. Decoupling orchestration logic from service layer provides with agility (services orthogonality, increased re-usability, and overall scalability of the system). The other orchestration purpose is in defining compositions (mashups) of services that significantly reduce complexity of the system to consumer (encapsulation of the composition’s inner organization increases its steadiness).
Enterprise integration methodology addresses orchestration with on the most complex patterns – process manager. With the benefit of centralized execution, simplified monitoring and prompt reaction on the changed situation, it adds significant complexity to design. Order of components execution (process) is described in the appropriate script. After each call to system components, control returns to the process manager that stores instances of the running processes, and knows, which next action should be executed within the process. Real-world example of the language that describes execution of activities is BPEL. BPEL is supported by a variety of process management engines (both commercial and open-source). Though it’s not an easy language to read (it’s rather machine-readable, than human-readable), majority of process management systems provide tools for visual process modeling, which make development rapid and comfortable (among them well-known TIBCO BusinessWorks, Microsoft BizTalk Server and many other)
Orchestration in REST
The composition of RESTful Web services is typically associated with so-called Web 2.0 Mashups, where this emerging technology helps to reduce the complexity and the effort involved in scraping the data out of HTML Web pages. Demand for orchestration has the very same nature as for the Big web services. The problem is that industry standard forWS orchestration, WS-BPEL, is tightly coupled with WSDL and can hardly be applied to REST. One way to work with a REST service in BPEL would be to generate WSDL/Schema that described the REST interactions and then create an adapter service or other means to communicate with the REST endpoint.
RS-world alternative to WSDL – WADL, which is claimed for repeating the mistakes of WSDL. Status and usability of WADL is still in question (it doesn’t have much followers), and it’s not supported by the current version of BPEL.
BPEL4REST is a lightweight BPEL extension, separate branch of BPEL, natively supports the composition of RESTful Web services using business processes. It declares communications with services without WADL interface.
Tools for RESTful orchestration
In spite of the fact orchestration is a trendy topic these days, there are not so many tools that can cope with REST orchestration. The engines I’ve set my choice on are:
a. Apache ODE (http://ode.apache.org/).
Pros: Apache reputation (long service life, overall solution quality); process container can be deployed to any application server and has an internal database (Derby).
Cons: supports only one orchestration language – WS-BPEL (primarily intended on integration of big services, though documentation has some good examples of declaring REST services as BPEL partners http://ode.apache.org/restful-bpel-part-ii.html ).
b. JBoss jBPM (http://www.jboss.com/products/jbpm/).
Pros: has visual process modeler; supports 3 orchestration languages (jPDL, BPEL, Pageflow); supports REST-services.
Cons: process server is the java application that was developed to work onJBoss (though there are many examples of porting Process Virtual Machine to other application servers on the Web, problems may exist, as PVM was tested only against JBoss)
c. JOpera for Eclipse (http://www.jopera.org/).
Pros: Big variety of components that can be parts of the process (not only WS or RS, but shell scripts, Java snippets, XSLT transformations, etc.); has good UI to design processes, based on Eclipse; process definitions (service compositions) deployed to JOpera server, can be accessed via REST and WS endpoints.
Cons: uses it’s own orchestration language built on top of BPEL; process server is tightly coupled with Jetty.
From me, subjectively, it’s a great joy to work with JOpera process designer. Development process wasn’t that fascinating to me for a long time;
Simple use-case
A simple use-case to demonstrate JOpera in action is caching of REST-service feedback via EhCache Server REST endpoint. The benefit of this approach is that the change is non-intrusive, and at any moment of time consumer may access both the original service and the composition (specified by the process).
Though it’s not the best example of a business process (as a matter of fact, caching has nothing to with business vertical), it can display implementation of different process tasks and elements inJOpera.
JOpera implementation
You can find basic information about JOpera installation at the home page (http://www.jopera.org/docs/help/jop.html). I’ll further concentrate on the steps required to implement the orchestration task described above. Service composition in JOpera is defined with a Process, which defines the control and data flow between the various components (the both flow are modelled visually).
(more…)