What I forgot to mention is that I also wanted to browse the queue in a non-transactional session, thereby avoiding the blocking receive done currently by the TransactedPollingJmsReceiver. This tries to consume from the queue in a transaction and then rolls back when the transaction times out, which is what I wanted to avoid.
0x6e6562 wrote:
I'm trying to create a JMS receiver that browses a queue in a controlling thread using the QueueBrowser interface and then when it finds something, for each message, it calls a worker thread to consume _a_ message with a non blocking call.
The idea is that the browsing thread can peek at the queue in a non-transactional session and if there is anything to consume, this can be farmed out to separate threads, thereby minimising the time any worker thread would idle when there is potentially work arrived in the queue but not yet farmed out.