I have j2ee based application that exposes synchronized webservices for a simple search function and do not have any web based application. i.e. A simple Java Class does some validate SOAP/XML and involved some business function, then invoked Stateless Session Bean to send/receive Queue Message to Other system.
The other system can only support Asynchronized communcation (i.e. Queue) and provide the results via Queue. Once message received from queue, my system will pick the message and re-validate the message then send back as response. Hope i followed MVC pattern model 1.
After implement this system, i have measured the end to end time. I feel this system doesn't comfortable for higher volumes of request/response. If i have lower volumes of req/res, it does good result. let say 200 concurrent request, it makes more delay around 2:30 min to wait to get response. It is too bad. I have listed below in detail spending more timings.
For (100 concurrent req/res)
All Validation doesn't take 00:01 (Sec)
Accquire the DB Connections 00:30 (sec) (Connection Pool)
(Check Already Sent the msg) 00:01 (Sec)
Insert Table (Log Entry) 00:03 (Sec)
Stateless Session Bean
Send Message 00:10 (Sec)
Receive Message 00:40 (Sec)
Update Table (Log Entry) 00:03 (Sec)
return to client 00:08 (Sec)
Total 01:37 (Sec)
So Each request bare min have to wait atleast a min to get response.
I cannot change Other system to expose as Webservices. There is some limitations they can provide support via Queue only.
1. Do i need to implement any pattern to improve ?
2. Ofcourse We cannot avoid 40 Sec to receive Message, remaining 50 Sec in our hand. Can we do something ?
3. How to avoid 30 Sec accquiring DB connection from connection pool ? I have set Connection Pool Size 10.
4. I do not have complex logic for Search/insert/update table. I have only one table for Log entry that updating status of each message. if message already sent, i will bypass send/recv message.
5. Can we implement Session Facade with Singleton or MVC model 2 pattern using Struts/Spring with Business Delegate, Session Facade, Command Bulder with Singleton ?
Appreciated, your help