红联Linux门户
Linux帮助

Implement two-way communication among ESB components

发布时间:2009-03-31 14:25:24来源:红联作者:jerry520
In this article, we look at how component-to-component interactions happen in a JBI-compliant way over an ESB, using the Loan Broker example bundled with the open source ESB ServiceMix.
A little JBI background The primary focus of the JBI specification is to define standards in the following areas:
[list=1][*]API and architecture for business-component-to-business-component interaction[*]Defined deployment descriptors and package mechanisms for business components and service units[*]Monitoring and management of the lifecycle of services deployed on an enterprise service bus[/list] JBIintroduces the concept of a normalized message router (NMR), which isthe backbone of all communication that happens within the ESB. As perthe JBI-defined architecture, the ESB can be viewed as a conglomerationof distributed services that interact with each other to provideservices to external clients. The JBI also defines a set of messageexchange patterns (MEPs) based on which services (provided throughcomponents) can communicate with each other over the NMR.
In this article, we look at how the In-Out MEP is used in ServiceMix's Loan Broker example to let components communicate with each other over the NMR.
Figure 1 is an excerpt from the JBI Specification regarding the In-Out MEP.
[img=350,267]http://www.javaworld.com/javaworld/jw-09-2006/images/jw-0904-jbi1-thumb.gif[/img]
Figure 1. In-Out MEP (as shown in the JBI Specification). Click on thumbnail to view full-sized image.
As shown in Figure 1:
[list][*]Consumer initiates with message[*]Provider responds with message or fault[*]Consumer responds with status[/list] Each message exchange sequence therefore has components playing the role of either consumer or producer:
[list][*]The consumer initiates the message exchange by creating a message exchange object.[*]Consumer then sends an "in" message over the NMR.[*]Provider receives the message, processes the message, and sends the "out" message (or a "fault" message) over the NMR.[*]Consumer receives the "out" message, processes it, and ends the message exchange sequence by setting the status to "done."[/list] Understanding the Loan Broker use-case The Loan Broker example is an ESB implementation for the use-case described in Enterprise Integration Patterns. I suggest you read and understand the use-case as stated in this book before going forward with this article.
Here is the abstract of the use-case:
[list=1][*]The use-case begins with the user submitting a request for a loan quote to a loan broker[*]The loan broker forwards the request to a credit agency for verification[*]Credit agency responds with the credit rating based on the user's credit history[*]The loan broker now submits a request for the loan quote to the lender gateway[*]The lender gateway returns the list of qualifying banks[*]The loan broker now sends a request to all of the qualifying banks for quotes[*]Each bank responds with its quote for the loan[*]The loan broker picks the best quote for the user and sends the response back to the user[/list] About the example Thesource for the Loan Broker example can be found in the [service mixinstall directory]\examples\loan-broker folder. The source of the LoanBroker example comes with two servicemix.xml files. The servicemix.xmlfile under the service mix install directory is used to startServiceMix without any components, service, or default service units.
文章评论

共有 0 条评论