Here's an example on how to do it https://community.jboss.org/message/639714#639714. It uses @Stateless in that example but applies to @MessageDriven beans too.
By default the MDB pool is configured to be of 20 max size.
I have set the MDB pool size with the help of above post.
Just i want to know the will jms queue store the queue messages in memory or harddrive.
I need to store the jms message on hard drive not on memory .
so that if the message increase in number. will not throw the OutOfMemory error.