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

  • SEARCH
  • Home
  • 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 7873679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:35:05+00:00 2026-06-03T02:35:05+00:00

I have a simple java web service. I want to have the web service

  • 0

I have a simple java web service. I want to have the web service be threaded, where each call to a web method gets its own thread to do processing. The processing takes a long time and I don’t want it to block, prevent other calls to the web method from happening. Instead, I want the web method to only create the Threads and for the Thread itself to respond/return a value to the client after its done processing. Is that possible?

EDIT:

Here’s a semi-pseudocode of what I have right now:

@WebService(endpointInterface="Service")
public class ServiceImpl {

    public ServiceImpl() 
    {
        // Initialization
    }

    public String GetResult(input)
    {
        // Does long processing

        return Result;
    }
}

What I want to do is instead of GetResult() doing the long processing, I want it only spawn the Runnable that will do the long processing and have GetResult() return and ready to service another request. I also want the Runnable to respond to the waiting client.

EDIT 2:

I just realized that I’m asking a silly question. I’m fairly new to implement WS’s. I had thought that WS’s only took one request at a time sequentially. I didn’t know each request is already automatically threaded.

  • 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-03T02:35:06+00:00Added an answer on June 3, 2026 at 2:35 am

    Yes, you can use JMS for asynchronous calls. That’s the best way.

    You could also fire up a thread, and manage them yourself. That’s not generally recommended. Good management of the thread pool, and keeping track of which threads might be taking to long requires a lot of overhead code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple web-service using Java. i want to load jars related
I have a simple web service method that returns a simple java class as
We currently have a java/jsp online web service that includes it's own custom calendar.
I have developed a simple Apache-Axis java web service using Eclipse IDE and now
i have created a Java Restful Web service . Now i want to access
I have a simple JSF web app as follows. The Java class contains: private
I have a simple Java class in which I invoke a call to a
For a new project, we want to build a web service in Java using
I want to provide a Java-based Web Service, but I don't require the features
I want to store an xml that I receive in my java web service.

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.