aspose file tools
The moose likes EJB and Other Java EE Technologies and the fly likes can we send the our message from onMessage method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "can we send the our message from onMessage method" Watch "can we send the our message from onMessage method" New topic
Author

can we send the our message from onMessage method

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I send a message to Queue from jsp.
then the MDB listening to messages get the message from Queue and process.
it is ok.
I need to get the message out from MDB.can we do some redirect or dispatcher to send message to jsp or servlet?
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2586

MDB are for accepting-messages only. If you need a duplex communication, it's better to choose another model.


Author of ExamLab - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
what can do MDB other than acceting messages?
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2586

Nothing. Listening to messages, accepting messages, and processing messages is all what an MDB can do.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I read that MDB can change the entity bean
Manning in Action EJB(Page 75/708)


All three of the processes persist data. The PlaceBidBean needs to add a bid
record to the database. Similarly, the PlaceOrderBean must add an order record.
Alternatively, the OrderBillingMDB updates the order record to reflect the results
of the billing process. These database changes are performed through two entities
in the JPA-managed persistence tier—the Bid and Order entities. While the
PlaceBidBean uses the Bid entity, the PlaceOrderBean and OrderBillingMDB use
the Order entity


[Devaka: Changed Code tags for Quote tags]

This message was edited 1 time. Last update was at by Devaka Cooray

Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2586

That's what I meant by 'processing messages'. In fact, MDBs are Listeners - it listens to messages and does whatever it is supposed to do, once a message is received.

This message was edited 1 time. Last update was at by Devaka Cooray

 
 
subject: can we send the our message from onMessage method
 
developer file tools