@JmsListener with concurrency
I am trying to use Spring API. I am trying to process multiple messages simultaneously and wanted the JMS listener to be running continuously so that I can process further steps while it is awaiting the message. I am getting below error when I add concurrency with JMSListener.
2021-05-21 16:26:57.922 WARN 164 --- [nerContainer-76] o.s.j.l.DefaultMessageListenerContainer : Execution of JMS message listener failed, and no ErrorHandler has been set.
javax.jms.IllegalStateException: The Session is closed. I am also attaching the code.
I am publishing message every 15000 ms. This is just to ensure that multiple messages are getting processed and it is not getting bottled up. As mentioned above, I am getting this issue only when I add concurrency in @JmsListener(destination = "accounts", concurrency = "15-20"). Can you please help?
Thanks and Regards,