| 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: 6720
|
|
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: 6720
|
|
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.
|
 |
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: 2231
|
|
As stated by Jai .
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?
|
 |
 |
|
|
subject: can Session beans allow us to send JMS messages
|
|
|