Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

JMS vs MDB

Posted on 2011-09-05
3
Medium Priority
?
556 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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 1000 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

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

704 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