Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Message Driven Beans Syn/Async ?

 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !
Can anyone tell me if message driven beans are used for synchornous or asynchonous messaging ? How do they differ if it is possible to use them in either ways ?
Thanks and Regards,
Leena
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
you can consume messages both, snyc and async.
as far as i know, please correct me if im wrong:
for asnyc processing you set a MessageListener (implement the onMessage method) and just wait for incomming messages.
p
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JMS is asynchronous, meaning the producer does not have to wait for the consumer. The consumer can block if they want but it is of no concern to the producer of the message.
 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A client may either synchronously receive a message consumer's messages or have the consumer asynchronously deliver them as they arrive.

For synchronous receipt, a client can request the next message from a message consumer using one of its receive methods. There are several variations of receive that allow a client to poll or wait for the next message.

For asynchronous delivery, a client can register a MessageListener object with a message consumer. As messages arrive at the message consumer, it delivers them by calling the MessageListener's onMessage method.
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Leena,


Can anyone tell me if message driven beans are used for synchornous or asynchonous messaging ?


MDBs don�t have any way to interact directly with the clients; this is why they have no home or remote interfaces. Therefore it makes no sense for MDBs to process messages synchronously. Even more, this is actually the reason why EJB 2.0 introduced the MDBs in the first place: prior the developers were forced to use all kind of "tricks", like startup classes in order to register an asynchronous listener to a JMS destination.
Regards.
 
What's that smell? I think this tiny ad may have stepped in something.
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic