Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8736895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:23:50+00:00 2026-06-13T10:23:50+00:00

Basically I have the problem of a long running task in my web application.

  • 0

Basically I have the problem of a long running task in my web application. Currently this task is executed by an EJB which is blocking for the time it is executing the task (task is an external programm and the EJB just waits for the result).

Now according to this post, I thought of using a Message Driven Bean together with a JMS Queue.

My Question: What are the advantages of this approach? If I’d annotate the calling method of the EJB as @Asychnronous wouldn’t I have the same features like with a MDB? Is the feature that pending jobs won’t be lost the only advantage of the JMS/MDB approach? In terms of resource management is it better to let an EJB wait for the result of the task or a MDB?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:23:53+00:00Added an answer on June 13, 2026 at 10:23 am

    I have used JMS for this pattern a lot, and the reason is that before EJB 3.1, it was simply not possible to make asynchronous calls to Session Beans. That’s why you are likely to find such code quite often in existing apps.

    Using asynchronous calls on EJBs has the benefit to be easier to setup (using JMS is not that complicated, but you need to create the resources, etc.). Using JMS has a couple of benefits if you are running in an environment where availability and scalability are important topics:

    • having JMS messages persisted is sometimes interesting, if you think about your app server crashing.
    • more importantly, in my opinion, using JMS makes it possible to add several “processing” nodes behind the JMS queue, which makes it easy to add capacity if your processing is long and your load increases (note that this can also be achieved by some app servers if you use remote session beans, but it’s not that simple).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a long-running application that basically: read packets off network save it somewhere
I have a WPF application in which i have to do a long running
Basically i have a problem with this timer program I am trying to put
I have basically the same problem outlined in this question, however I am using
So basically I have this relatively long stored procedure. The basic execution flow is
I have a problem with a page that's taking a long time to refresh
I have a problem trying to design some generic storage.. Basically I have the
I have a strange problem with my WPF control. Basically I have a control
I have small problem with Spring MVC. Basically what I'm trying to do is
I have a problem with my BroadcastReceiver. Basically, I have a function in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.