Solved

JMS vs MDB

Posted on 2011-09-05
3
480 Views
Last Modified: 2012-08-13
i would like to know differences between JMS and MDB(message driven bean). Advantages, disadvantages, uses, comparisons of each other. when, where, how, why we use them. thanks in advance
0
Comment
Question by:gudii9
  • 2
3 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36485307

JMS is Java API which allows to send and receive messages between the
java cprograms; see general description here
http://en.wikipedia.org/wiki/Java_Message_Service

as opposed to calling methods of the objects sending essages like in real life do not require
synchronous execution (this moment presence) - you'd normally sed the message and when that
your addresse picks up the message then it would send you an answer as opposed to calling the method
which normally implies immediate execution.
So JMS defines various object like the queue of messages, etc.
and like any other API defines methods of these objects which faciolitie this process of communication.
0
 
LVL 47

Accepted Solution

by:
for_yan earned 250 total points
ID: 36485317

A message-driven bean is an enterprise bean that allows J2EE applications to process messages asynchronously. It acts as a JMS message listener, which is similar to an event listener except that it receives messages instead of events. The messages may be sent by any J2EE component--an application client, another enterprise bean, or a Web component--or by a JMS application or system that does not use J2EE technology.

see here:

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts5.html

So message driven bean will process JMS Messages so it uses JMS API - in this way they are related
0
 
LVL 1

Assisted Solution

by:sreekanthbhargav
sreekanthbhargav earned 250 total points
ID: 36486926
Hi ...

Here iam giving small overview, please go through the J2ee documentation for detailed explanation.

JMS  (Java Messaging Service) is messaging middleware API developed to exchange the messages between the enterprise applications.

1) point to point (Queues)
2) publishing/subscribing (Topic)

Message drive Bean is the Enterprise java bean is part of EJB specially designed to cater the JMS needs in the J2ee environment.


In JMS, there is publish and subscribing API for the both the Queues and Topic.
 There are two types of communications i.e. synchronous and asynchronous.

Synchronous: the subscriber utility has to be invoked to pick the message from the JMS Queue/Topic

Asynchronous:_ the subscriber utility continuously listening to the JMS Queue by implementing the MessageListner interface, once the message arrived to the queue, it will start picking the message imediately. No need to invoke the utility every time to pick the message.

For Enterprise applications, almost the number of messages received by the JMS queues are in huge numbers.
So normal JMS subscriber utility which is implemented Asynchronous jms api can not handle the requests effectively.

To over come this, MDB introduced which is also implemented the Message Listener interface deployed as EJB module in Application server having capability of processing (subscribing from the JMS Message Queue) multiple requests in distributed environment with scalability and security.


Thanks,
Sreekanth


0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now