What is the difference between JMS consumer and Message Driven Beans (MDB)
Asked Answered
G

1

10

Is there any difference between an asynchronous JMS (Java Messaging Service) consumer vs an actual MDB (Message Driven Bean). The only difference I see is the MDB class has @MessageDriven annotation which the asynchronous JMS consumer doesn't.

Anything else that I am missing ?

Ghiberti answered 13/4, 2011 at 21:10 Comment(0)
F
8

Your MDB works as JMS consumer in your case. MDB is EJB specific term and consumer is a JMS term. A JMS consumer can be a message driven POJO as well which is not technically an EJB.

Answers to comments

A1. Yes it is correct to say that a plain JMS consumer cannot be pooled/managed like an EJB unless that JMS consumer happens to be managed by containers like EJB or Spring containers.

A2. MDBs really just fulfills the requirement for asynchronous communication with EJBs. When they are JMS based then your MDB is technically a JMS Consumer as well. But an MDB can be non-JMS based as well eg: JCA (Java Connector Architecture) based MDB. You can see this post for more details about non-JMS based MDB: http://debupanda.blogspot.com/2006/08/using-ejb-30-message-driven-bean-with.html

Finial answered 13/4, 2011 at 21:16 Comment(3)
thx for your reply... to further elaborate on what you said I think it would be correct to say that a plain JMS consumer cannot be pooled/controlled(lifecycle-wise)/administered using an EJB container like an MDB can be ? Is that correct ?Ghiberti
just curious - what other messaging infrastructures can the MDBs work in ... other than JMS ? [ this question got raised from your comment about "Your MDB works as JMS consumer in your case"] I know they can, but haven't seen much links from a google search pointing to those other options that MDBs can be used in...Ghiberti
@rooban bajwa: Answered your questions above since comment has limited space.Finial

© 2022 - 2024 — McMap. All rights reserved.