concept message - drive bean in category jboss

appears as: message-driven bes, message-driven be, message-driven bean
JBoss in Action: Configuring the JBoss Application Server

This is an excerpt from Manning's book JBoss in Action: Configuring the JBoss Application Server.

The EJB3 specification defines three types of enterprise bean objects: session beans, entity objects, and message-driven beans. Session beans are typically used to write business code encapsulated in a larger business transaction that may make calls to other transactional components. For example, a session bean might be used to make a reservation through a hotel reservation site. The code in the bean may check for room availability, reserve the room, and then send an asynchronous message to a third-party clearinghouse used by other reservation systems to notify them that the room has been reserved. All this might be encapsulated in a single transaction.

Entities are objects that represent domain objects mapped to the database. Entity persistence is either encapsulated by a database transaction or part of a larger business transaction. Message-driven beans are asynchronous message consumers managed by a container.

You need to write both a publisher and a subscriber, and both need to access the same topics, one to notify the customers of new videos and the other to send the customers’ requests to the store. A message can identify a dynamic queue on which the receiver can reply to a message, simplifying the process; but there’s a method to our madness, and you must wait until we cover message-driven beans in section 8.3 to find out why.