Chapter 8. Message-Driven Beans: Getting the Message

image with no caption

It’s fun to receive messages. Not as much fun as, say, getting that EBay package with the genuine Smurf™ lamp, but fun and efficient nonetheless. Imagine if you sent your order to EBay, and you couldn’t leave your house until the package was delivered. That’s what it’s like with Session and Entity beans, because there’s all calls to a bean’s client interface (home, component, local, Remote, doesn’t matter) are synchronous. But with message-driven beans, the client makes a message and sends it to a messaging service. Then the client walks away. Later, the messaging service sends the Container the message, and the Container give it to a message-driven bean.

Get Head First EJB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.