I build 3 Applications,each Application takes more than 20 min for evaluation.I placed 3 files in the following directories
ProjectcContextPath/WEB-INF/classes/
Based on these requirements
you could implement a stand-alone application which receives messages synchronously like this (pseudo code):
while (true) {
Message message = queueReceiver.receive();
TextMessage textmsg = (TextMessage) message;
if (textmsg.getText().equals("service1")) {
new Service1().execute();
} else if (textmsg.getText().equals("service2")) {
new Service2().execute();
} else {
// Show error
}
message.acknowledge();
}
This job runs continuously.
The differences to your proposal
main
method) instead of a servlet. A servlet is not suitable (because it does not run continuously)Update
If your services are only reachable over HTTP (this is the case with servlets/JSP), then you could implement these as a web service.