Skip to Main Content
Java Message Service, 2nd Edition
book

Java Message Service, 2nd Edition

by Mark Richards, Richard Monson-Haefel, David A Chappell
May 2009
Intermediate to advanced content levelIntermediate to advanced
330 pages
10h 34m
English
O'Reilly Media, Inc.
Content preview from Java Message Service, 2nd Edition

Message-Driven Bean Use Cases

We saw earlier in the chapter that within the Java EE environment, session beans and web components can only receive messages synchronously, whereas message-driven beans can receive messages asynchronously. While this is a key point for the usefulness of MDBs, there are several other use cases that make MDBs a good design choice.

Message Facade

There may be times when you want to expose business functionality written in Java to remote client applications outside of the EJB container. This is typically done though the use of the Session Facade pattern. In Java EE, this pattern is implemented via stateless session beans that act as the remote entry point to the business functionality we want to expose. However, this implementation assumes that the client invoking the service is written in Java, can support the RMI/IIOP protocol, and has the necessary interfaces, stubs, and skeletons to access the remote session bean. While this solution is valid for Java-based client applications, it does not lend itself well to interoperability with non-Java clients or Java clients outside of the Java EE environment.

Another approach for exposing business functionality within an EJB container to outside client applications is through the use of the Message Facade pattern. Using a message-driven bean as a facade to business functionality (services) decouples client applications from the service implementation, allowing for greater flexibility and interoperability, particularly ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reactive Systems in Java

Reactive Systems in Java

Clement Escoffier, Ken Finnigan
Java 8 in Action

Java 8 in Action

Mario Fusco, Alan Mycroft, Raoul-Gabriel Urma
The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

Benjamin Evans, Martijn Verburg, Jason Clark

Publisher Resources

ISBN: 9780596802264Supplemental ContentErrata Page