• Post Reply Bookmark Topic Watch Topic
  • New Topic

can Session beans allow us to send JMS messages

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)can Session beans allow us to send JMS messages ?
2)If yes ,How?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but session beans doesn't have onMessage method?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need any onMessage method to *send* JMS messages. Please read the tutorial for more details.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there any other thing it can be consumers other than MDbs?
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!