this month in ejb home ill show you how to build a message-driven bean. knowledge of this ejb will enhance your toolkit for developing asynchronous enterprise java applications - whether theyre mission-critical or not.
the enterprise javabeans specification 2.0 introduced another bean into the mix. one of the primary goals for the ejb 2.0 release was to define how ejb interacts with the java message service (jms), thereby defining how these enterprise java apis interact within the java 2 enterprise edition (j2ee) platform. until version 2.0 of the specification was released, the defined enterprise beans, entity and session, supported only synchronous operations. however, the need to perform asynchronous processing is critical in many high-volume applications.
years ago, for example, i worked on a messaging system for norad at cheyenne mountain in colorado. the system needed to process thousands of messages a second to multiple subscribers. the messages needed to be in the correct order, and not a single message could be lost - not a single one! this is an example of a mission-critical messaging application.
while messaging systems are crucial to mission-critical applications, often theres less critical yet useful functionality that can be off-loaded to an asynchronous process. for instance, jms is a practical solution for sending e-mails and logging events. using a messaging service to perform the processing allows for quicker response time to an end user, as he or she isnt held up while the system sends the e-mail.
jms in a small nutshell
before building a message-driven bean, ill cover some basics of the java message service. jms is an api for message-based systems. its generic enough to allow existing messaging products like ibms mqseries to incorporate it into their offering, yet powerful and flexible enough to provide a rich feature set for enterprise-level messag... 下一页