The app server will create a pool of MDB instances and give each one the next message in the queue. Thus there is no need for you to fork off a thread. The pool size is configurable - you get 15 instances by default. A while ago I ran some tests that numbered the instances.
You didn't mention which version of JBoss AS, nor which level of EJB, so I will assume AS 5.1.0 and EJB 3. You can change the limit in ejb3-interceptors-aop.xml file, look for the Message Driven Beans entry, the maxSize portion of the default annotation. Of course, you can also apply your own @Pool annotation to your MDB.
Don't thing wrongly. I got your answer and I implemented the same in my code.
I just need to know in jboss can we create Thread pool if yes how can we do that.
Its not at all related to my old requirement I just want to know.
Like Connection pool, MDB pool is it possible to create Thread pool.
You should not be messing around with thread pools in your own code. Things such as user credentials and transaction state are maintained in thread-local storage. As soon as you spawn off other threads there is the possibility that you will lose that information. I don't know if the thread pool mechanism will copy the thread-local storage to the thread allocated from the pool.