We have one service which takes xml as input and returns pdf as output. we want to throttle the requests to this service and queue up the subsequent request(In short we'll limit number of concurrent requests).
What can be the best approach for this solution? we are using websphere 6.ov application server.
we are thinking to use JMS with Websphere's default messaging service Queues (we don't want to use MQ)but challenge is to send the returned PDF to the respective requests. (To send response like we do in synchronous communication).
can some expert give any better suggestion/solution?
Originally posted by Nikhi Joshi: Actually, I need to maintain the client's identity/state, as service need to send a PDF back to respective client. I guess that won't be possible the stateless bean, Isn't it?
Why not? A session bean is synchronous. The caller would know which client to send the response to.
Joined: Jun 28, 2008
Ok..you are right..
So here is my understanding of entire scenario , please correct me if i goes wrong...
So Lets say I set bean pool size min to 20 and max to 200.....
1. Till 20 concurrent requests will be served directly without any pooling. [ that many instances of bean create, right? ]
2. In case of say 50 concurrent requests ....... 30 requests/bean instances will be pooled while serving 20 directly.
3. what will happen if more than 200 concurrent requests occurs?
1) I'm not sure what you mean by "without pooling." There are still 20 in the pool; just that they are all going at the same time. 20 beans are created 2) The pool grows to 50. All 50 are pooled and going at the same time. 3) The pool grows to 200. The first 200 go at the same time and the rest wait for a bean to return to the pool.
If you want 20 at a time, you use a maximum pool size of 20. In your example, you are throttling to 200 at a time.
And questions are good! They help clarify understanding.