JMS Producer and Consumer taking too much time. Why?

I have used ActiveMQ as broker and JMS to receive async. messages in queue then start consuming these messages as soon as message comes in queue.
For this i have Written producer and consumer code.
Everything is working fine but the entire process is taking too much time around 2-3 minutes for 10000 records.(i have used a loop just for simulation)
Below is the entire code:

I am not sure about the SLA that you are expecting, but your message Broker is working at the rate of 80 messages/sec (approx.), which is NOT bad.

And one issue with your code is session.createProducer(queue) is the problem for the time lag as it is a costly operation (takes time) and you can use a single producer object to produce multiple messages.

You have to close both producer and session objects in the finally block.

P.S.: Also, as a side note, it would be good if you name your producer class name as JmsMessagePrducer instead of JmsMessageListener as in general we use the name as Listener only for JMS consumers.

UPDATE:

I just want to know that is it good to process around 80
messages/sec.? that too without any operation after consuming. What if
add more tasks after message consumption from queue, like inserting in
db or some business operation.

It is NOT wise to simply tell that 80 messages/sec is better or 50 messages/seconds is better without knowing which Server/OS/etc...(parameters need to be considered). When it comes to performance requirements you need to specify/define the requirements first.

Your current code processes around 80 messages/sec, then that is what your application benchmark is, for the given conditions. So if you feel like it is NOT meeting your performance requirements, then you need to configure multiple JMS listeners to process messages parallelly and change your design.