We have a SOAP webservice deployed on Weblogic server with the flow as follows.
SOAP Client will send message to Webservice which validates the message and sends an Acknowledgement as response of the service. However, it is suppose to do a SocketConnection in the background to further process the message as asynchronously.
The implementation that has been provided is to spawn a ChildThread in the background using ExecutorService.newFixedThreadPool
. this is the code being used (not all the code for the webservice implementation file is posted here).
if ("103".equals(requestType)) {
ExecutorService executorService = Executors.newFixedThreadPool(1);
executorService.submit(new MessageProcessing103(coreMsg, otherDetails));
} else if ("104".requestType) {
ExecutorService executorService = Executors.newFixedThreadPool(1);
executorService.submit(new MessageProcessing104(coreMsg, otherDetails));
}
With the above implementation Scalability is definitely an issue but we can live with it as of now. Can you help with the below queries though
- Since background thread is long living does that mean the same spawned thread will be used to execute all the requests?
- If two requests come in at an interval of within few seconds, will the second request be in waiting state or new thread will be spawned?
- We are not shutting down the executor so what would be the issues encountered in such a case?