Java EE 5 - How to implement an async method call without JMS

We have an old application that runs on JBoss EAP 5.1 and provides a web service that calls a long-running ejb method, so we would like to integrate the simple control of the asynchronous call of this method, just something like this:
when the client calls the endpoint method , the server immediately returns the UUID, and then calls the business logic method in a separate thread.
What is the best way to implement this without using JMS ?

+4
source share
3 answers

You can use the java 5 ExecutorService function, which will provide an implementation of the thread pool type. You can create a runnable object and send it to the thread pool. The business method can be called by the run runableable method.

+1
source

With EJB 3.1 you can make asynchronous method calls. If you use Java 6 o later, one of the features can be annotated with your ejb business method using the @Asynchronous annotation. That way, when you call ejb from a web service, the ejb container immediately returns the WS control.

ejb , , . , , , , Future.

, ejb. JEE 7 (JSR 236: Concurrency ) .

0

bean (MDB) WebService , MDB. MDB bean onMessage. EJB3.0 JBoss 5.1

Have a look here: http://docs.oracle.com/javaee/5/tutorial/doc/bnbpk.html  or for the full specification: http://download.oracle.com/otndocs/jcp/ejb-3_0-fr-eval -oth-JSpec /

0
source