J2EE Messaging
897
System Integration with JMS and XML
JMS and XML are good tools to use for system integration. XML is a particularly good way to transport
data between systems because the XML message contains a description of its own structure, which
eliminates the need to translate data definitions into the language of each system. You can use XSLT to
convert XML to and from other data types. Also, XML can be used to describe interfaces in a way that
can be interpreted by any system.
Legacy Integration
Companies often maintain legacy systems, which are written in older programming languages and run on
mainframe computers. A company is rarely willing to spend the money and time to develop a new system
if it already has a working one. It is possible to use JMS to connect legacy systems to systems written in a
more modern language. In particular, people are often interested in Web-enabling legacy systems.
Consider, as an example, a large bank that has a huge bank account management application, written in
FORTRAN. The bank wishes to provide online banking to its customers. It doesn't want to pay to hire
consultants to write a new application in Java so it decides to Web-enable the existing application.
A common way to connect a legacy system to a newer system with messaging is to use an Enterprise
Application Integration (EAI) product with messaging, which communicates with the legacy system and
has the capability to send and receive messages. Many EAI products that support JMS are available on
the market (see http://www.infact-res.co.uk/crmuniverse/eai.htm for a comprehensive list of vendors).
The developers design a system in which the web portion provides the bank's customers with an
interface by which to view and change their bank account data online. When a customer updates their
account information, Java code in the Web portion of the program creates an XML message that
contains the new account information and an indication that the account is being updated. The EAI
product receives the message and translates the XML request into a FORTRAN function call.
The XML message requesting the legacy application to update the customer's record might look like this:
<transaction>
<function-name>updateCustomerRecord</function-name>
<parameters>
<bank-account-number>11235</bank-account-number>
<first-name>Kelly</first-name>
<last-name>Poon</last-name>
<address>
<street-number>5</street-number>
<street-name>Leilu St.</street-name>
<city>Cabana City</city>
<state>CA</state>
<zip>27182</zip>
</address>
<phone-number>(314)159-2653</phone-number>
</parameters>
<transaction>
The web portion of the application may also create XML messages that include a request for
information. In this case, when the FORTRAN function call returns, the EAI product bundles the
results of the call into an XML message and replies to the original message.