Difference Between an Enterprise Application Client and an EJB

Posted on 2008-11-03
Last Modified: 2013-11-24

I want to build a J2EE JMS Application using Glassfish Application Server.
is it better to make an Application Client or a Message Driven Bean (MDB)  ?

Also, I would like to know the Difference between the two.
Thanks !
Question by:dtivmk
    1 Comment
    LVL 4

    Accepted Solution

    An application client is a standalone JAVA program, which needs to have the main method. A message driven bean (MDB) is a JEE component that is managed by the JEE container. In order for an MDB to consume messages it needs to be deployed in a runing JEE container (in your case, Glassfish).

    The advantage of an MDB is that the container manages transactions, security, resource, concurrency and message acknowledgement. When you write a standalone client you have to write custom code that deals with all this. Especially the concurrency part is very interesting. Using MDB's, the container can consume 100's of messages concurrently.

    Since you will be using Glassfish anyway,  I do not see the advantage of having a standalone client to consume messages. I would go for MDB's.

    MDB's are specially designed to consume JMS messages. However, JMS messages can easily be produced in any component (for example servlets, session beans, message driven beans, standalone clients...). For example, when a business method is invoked on a session bean, the business logic might decide to do a task asynchronously by sending a message to a destination using a connection to a JMS provider.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    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!

    Suggested Solutions

    I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
    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.
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    760 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

    12 Experts available now in Live!

    Get 1:1 Help Now