I have a relatively simple java service that fetches information from various SOAP webservices and does so using apache cxf 2.5.2 under the hood. The service launches 20 worker threads to churn through 1000-8000 requests every hour and each request could make 2-5 webservice calls depending on the nature of the request.
Setup
- I am using connection pooling on the webservice connections
- Connection Timeout is set to 2 seconds in order to realistically tackle the volume of requests efficiently.
- All connections are going out through a http proxy.
- 20 Worker Threads
- Grunty 16 cpu box
The problem is that I am starting to see ‘connect time out’ errors in the logs and quite a large number of them and it seems the the application service is also effecting the machines network performance as curl from the command line takes >5 seconds just establish a connection to the same webservices. However when I stop the service application, curl performance improves drastically to < 5ms
How have other people tackled this situation using CXF? did it work or did they switch to a different library? If you were to start from scratch how would you design for ‘small payload high frequency’ transactions?
Once we had the similar problem as yours that the request took very long time to complete. It is not
CXFissue, every web services’ stacks will operate long for very frequent request.To solve this issue we implemented
JMS EJBmessage driven bean. The flow were as follows: when the users send their request to web service, all requests were put intoJMSqueue so that response to users come very quickly and request is left to process at the background. Later the users were able to see their operations: if they are still send to process, if they are processing, if they are completed successfully or if they failed to complete for some reason.If I had to design frequent transactions application, I would definitely use
JMSfor that.Hope this helps.