• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JMS and MDB

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

When to usa JMS as opposed to MDB?
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mary,

EJB components (other than MDB), can act as JMS producers creating and sending messages to JMS destinations. However they cannot act as an asynchronous JMS consumers. A SLSB can use JMS API and waiting for a message, but this synchronous operation could block the thread indefinitely. This was the reason why MDB were added to EJB2.0 in the first place anyway: to allow J2EE component to asynchronously process JMS message. Besides is much easier to develop a MDB consumer than using JMS API and write your own.
As for your question is very hard for me to imagine why to use JMS API when building a J2EE application; it might be a good solution for integrating with other queuing services, like IBM MQSeries, or having a simple JMS client application, but that�s another story. One reason not to use MDB might be the need to implement a JMS consumer that processes messages synchronously. But in that case why to use JMS in the first place anyway?
I hope this will help.
Regards.
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thx for your reply

I got it
reply
    Bookmark Topic Watch Topic
  • New Topic