File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and Other Java EE Technologies and the fly likes can Session beans allow us to  send JMS messages Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "can Session beans allow us to  send JMS messages" Watch "can Session beans allow us to  send JMS messages" New topic
Author

can Session beans allow us to send JMS messages

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
1)can Session beans allow us to send JMS messages ?
2)If yes ,How?
Jaikiran Pai
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6564

Samanthi perera wrote:1)can Session beans allow us to send JMS messages ?

Yes, you can send JMS messages from within session beans.

Samanthi perera wrote:
2)If yes ,How?


The same way as you do from any other client code. Have you read the JMS tutorial?


[My Blog] [JavaRanch Journal]
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
but session beans doesn't have onMessage method?
Jaikiran Pai
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6564

You don't need any onMessage method to *send* JMS messages. Please read the tutorial for more details.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
ok.
sessionbean send messages to Queue or topic.
then MDB listen to messages and when there is a message it take the message.
then who is the consumer?
is consumer MDB?
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

is consumer MDB?

A consumer is any class that implements the MessageListener and subscribes to the topic/queue.
An MDB is a MessageListener (implements the interface) and hence is a consumer.
An MDB is also an EnterpriseBean - so you can use Container supported transactions, object pooling features right out of the box as you would with any ejb.

ram.

This message was edited 1 time. Last update was at by ramprasad madathil

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
is there any other thing it can be consumers other than MDbs?
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2229

As stated by Jai .
A consumer is any class that implements the MessageListener


Let me explain you more clearly ,Any class can be Consumer if it implements the MessageListener , and we normally go for MDB as the container takes care of all things like MDB instance creation and many other things .

Save India From Corruption - Anna Hazare.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
ok.
1)client send messages to Queue.
2)MDB gets messages from Queue.

Is this the whole process?
But i read that MDB is a like a voice mail.It doesn't need to present both message sender and receiver.
anyway Isn't there any other process?

This message was edited 1 time. Last update was at by Samanthi perera

 
 
subject: can Session beans allow us to send JMS messages
 
developer file tools