This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes How to receive message from a MDB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to receive message from a MDB?" Watch "How to receive message from a MDB?" New topic
Author

How to receive message from a MDB?

Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 61
I created and deployed a MDB. I built a test client which send message to the MDB. It looks as follow:


Now I try to build a test client to receive the message. My codes look as folow:


But as I run it, but it seems it doesn't go to end. It is waiting...
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
What you have written is a message listener and not an MDB. Your message listener program ends before the onMessage() method can be called on the Listener. You need to keep your program alive so that the onMessage method be called.


Amit Tank
Linked In
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to receive message from a MDB?