Affects Version/s: v3.0.1
Fix Version/s: None
We found an issue when using JMS from a timer bean. Attached is a simplified program from what we use. A timer bean periodically checks on some task to execute. The result can be the execution of none, one or more tasks. Each task should be executed in a new transaction as the time out method is annotated not to use transactions.
When the task is finished a message is pushed into a JMS queue. However, when there are a lot of tasks to execute (more then the pool size) the connection pool runs out of connections. This is strange as after each transaction the connection should be put back. Standard JMS is code is used. The message logged is
The strange thing however is, when the JMS is used in the same code, but then from a Synchronization using TransactionSynchronizationRegistry all is fine. This can be enabled in the code removing the comments from TimeInputQueue.java (and then comment the 'sendToProcessingQueue' line. Also using the code from a servlet or REST resource is fine.
This happens with GF 3.0.1 and 220.127.116.11.
To reproduce build attached sources and deploy. The timer bean kicks in after two minutes trying to put 50 messages in a queue where 32 connections are available in the queue. Embedded JMS is used here. The application configures itself using a resource description XML and requires no database.
Is it the way of using the transaction attribute, jms or what?