Messaging Concepts Introduction Messaging is a method of communication between software components or applications. A messaging system is a peer-to-peer facility A messaging client can send [...]
JMS API The Java Message Service is a Java API that allows applications to create, send, receive, and read messages. The JMS API defines a common set of interfaces and associated semantics that [...]
JMS Programming Model ConnectionFactory an administered object that encapsulates a set of connection configuration parameters. A client uses it to create a Connection to a JMS provider. JMS [...]
Message Driven Bean A message-driven bean (MDB) is an enterprise bean that allows Java EE applications to process messages asynchronously. In other words, an MDB is an asynchronous message [...]
To a client, a message-driven bean is a message consumer that implements some business logic running on the server. The most visible difference between message-driven beans and session beans is [...]
Lifecycle callback methods The following lifecycle event callbacks are supported for message-driven beans. PostConstruct The PostConstruct callback occurs after the container creates a new [...]
The container can pool MDB instances in the same way as it does for stateless session beans. As soon as a new message reaches the destination, an MDB instance is retrieved from the pool to handle [...]
MDB class must directly (using implements keyword) or indirectly (using annotation or descriptors) implement a message listener interface. Example, Using implements keyword Using annotation It is [...]
@MessageDriven The @MessageDriven annotation is used to mark the class as Message-Driven Bean. This annotation’s specification is as follows. @Target(value=TYPE) @Retention(value=RUNTIME) [...]
EJB3 Message Driven Bean In this example, we are going to create an MDB which consumes the message sent to the Queue Destination and a JMS Application Client which sends the message to the Queue [...]