phil.e.b
phil.e.b

Reputation: 2621

Java web app framework to handle client callbacks for processes that take long time to compute

I would like to get some input on some ways to handle long computational tasks within a java web framework and how to callback to a browser client.

I have come accross JBoss remoting, and Spring remoting.

Want to be able to have the client send a request for processing. Processing can take X time, and once complete responds to the client.

Any pros and cons and suggestions welcome.

Thanks.

Upvotes: 0

Views: 294

Answers (3)

rjdamore
rjdamore

Reputation: 308

You could use GWT, it handles asynchronous calls quite well. I have huge data loads done in the background of a lot of my applications. All while the user can interact with various views etc.... It's quite seamlessly integrated into GWT, with their home-cooked rpc mechanism. Also, you can use JBoss Errai to do pushing if you need that as well, (within gwt of course). It's worth a look.

I have to use Icefaces for some legacy projects and it is so difficult to do this same thing. GWT just makes it easy. Icefaces you need to use JS unless you bind your async calls to a component such as a button and make sure the requests are not queued. It's messy.

Just my two cents I guess.

Upvotes: 0

EdH
EdH

Reputation: 5003

Executing a long computational task and server push for web applications are two separate things, really.

As mentioned, web applications using comet will allow the server push (which is a term for when a Web Server can push updates to a browser without the browser initiating a request). There are frameworks which build on top of this. ICEfaces, Primefaces and ZK are three web application frameworks which support this. Flex has its own support for pushing data from the service layer as well.

The async executions could be anything as simple as a thread spawned off that runs and has enough information to start the server push process back to the client. You could also use message-based solutions to handle the async execution of the long process.

There are a lot of options out there, and it really comes down to what tools/frameworks you're currently using and find a good fit.

Upvotes: 0

Perception
Perception

Reputation: 80593

There are several ways this might be accomplished:

  • Utilize Servlet 3.0 with an AsyncTask.
  • Incorporate a Comet implementation with either long-polling by your UI, or server push.
  • Build your UI with HTML5, and utilize WebSockets (least portable solution).

Both JBoss and Spring Remoting might also be viable solutions, but they really were built for different purposes.

Upvotes: 1

Related Questions