23.07.2013 Views

O'Reilly - Java Message Service

O'Reilly - Java Message Service

O'Reilly - Java Message Service

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Java</strong> <strong>Message</strong> <strong>Service</strong><br />

already use for electronic communication. An Electronic Data Interchange (EDI) system<br />

may have nightly batch jobs that export flat files to an FTP site. A trading partner may<br />

expect to send and receive HTTP transmissions as its way of communicating with the<br />

outside world. A supply chain portal may require that you install one of their clients on<br />

your site in order to communicate with them through whatever protocol they dictate.<br />

Sometimes email is required as a way of sending a "Thank you for your order" message.<br />

Ideally each of these outside entities would have a close working relationship with you,<br />

and would allow you to install a JMS client at each site. That would make communication<br />

very easy - but it's not how the world works. These other communication mechanisms may<br />

have been in place for a number of years, and their users aren't about to rip them out just<br />

because you want them to. They may not be capable of changing the way their systems<br />

work just to accommodate your JMS provider. These are "legacy systems"; in the future,<br />

they may gradually disappear, but for the time being, we have to figure out how to work<br />

with them.<br />

Someday JMS may provide on-the-wire interoperability, and be ubiquitous. Until then, we<br />

are left to building bridges, or connectors to those other protocols. As illustrated in Figure<br />

7.1, a connector is simply a JMS client. Its sole purpose is to receive data using the foreign<br />

protocol, create a JMS message, and send it along through your JMS-based system.<br />

Likewise an outbound connector would listen for messages from your JMS-based system<br />

and transmit the message out into the world using the protocol expected by the entity at the<br />

other end.<br />

Figure 7.1. JMS clients can be dedicated as protocol connectors to the outside world<br />

The JMS specification does not suggest this notion of connectors. [7] However, legacy<br />

systems are a fact of life. In recognition of this, most JMS vendors are starting to provide<br />

connectors to legacy systems as a way to provide added value. If your JMS provider does<br />

not support the connector you are looking for, it is typically easy enough to write your<br />

own. In fact, this is an ideal situation for using CLIENT_ACKNOWLEDGE mode. As illustrated in<br />

Figure 7.2, a JMS consumer can explicitly acknowledge the receipt of the message once its<br />

data transmission has been successfully completed.<br />

[7] The use of the term "connector" in this discussion should not be confused with "connectors" as<br />

defined by the J2EE connector specification - a different thing altogether.<br />

119

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!