Method calls, local or remote, are synchronous. The caller is stuck waiting until the server returns.
Message-driven beans (added in EJB 2.0) give you asynchronous communication between the client (message sender) and the server (message receiver).
In messaging terms, the sender is called the message Producer and the receiver is called the message Consumer.
With messaging, the Producer sends a message and then goes about his business. He doesn’t have to wait for the Consumer to even get the message, let alone process it.
When the Consumer gets a message, he processes it. In the meantime, the client can still have a life.
Message-driven bean overview
Client (Producer) send a message to the messaging service.
Message is delivered to the Container. Client is doing other client things.
Container acknowledges the message to the service, and pulls a bean out of the pool to process the message.
Container invokes the beans onMessage() method, with the message as the argument.
The bean’s transaction commits, and the Container sends the bean back to the pool. ...