Design problem: EJB containers prevent threadpool allocation


EJB design: Design problem: EJB containers prevent threadpool allocation

  1. I have a design issue I'm working through - I'm attempting to limit requests into a remote system to a set number per client. So for each client we have, I want a max of (for example) 15 requests to be sent to the system. Clients are added and removed constantly so extra development for each client is out of the question. In normal Java I would just create a new client object that allocates a thread pool and send requests into each client. The thread pool would limit the number of active requests in the system and all is well. However, this logic will not work in EJB land because the container does not like application code allocating thread pools. The only other way I can think of to implement anything like this would be to submit jobs to a queue and have an MDB pull off the queue with a fixed pool size. But this solution would not allow for dynamically increasing the number of clients (we would need to allocate a new pool for each client). So, is there a way to create & limit asynchronous processes using JBoss/EJB's?
  2. Hi, I want to clarify some of the things in your question. 1. Client in your question means is it a WebClient or an application client. 2. Is there a way that your client can be identified by an unique identifier. Also you have mentioned like creat and limit asynchronous process. Can you explain more about this? It would be good if you provide the above information so that i can narrow down to get a better design approach.