Solved

JMS vs MDB

Posted on 2011-09-05
3
477 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

747 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

13 Experts available now in Live!

Get 1:1 Help Now