I'm interrested for the solution or a clear explanation on this because all this is complicated...
* SessionTransacted=true: means ActiveMQ manage the transaction? Doesn't seem
* Setting a transactionManager in DefaultMessageListenerContainer disables the CacheLevel (this.cacheLevel = (getTransactionManager() != null ? CACHE_NONE : CACHE_CONSUMER)
* Setting a transactionManager automatically activates the sessionTransacted
Code:
(AbstractPollingMessageListenerContainer)
public void initialize() {
// Set sessionTransacted=true in case of a non-JTA transaction manager.
if (!this.sessionTransactedCalled &&
this.transactionManager instanceof ResourceTransactionManager &&
!TransactionSynchronizationUtils.sameResourceFactory(
(ResourceTransactionManager) this.transactionManager, getConnectionFactory())) {
super.setSessionTransacted(true);
}
* RedeliveryPolicy doesn't seem active when using transactionManager.
* Message are not redelivered even when settings RedeliveryCounter to -1 (NO_MAXIMUM_REDELIVERIES). Worst, they are dropped off in DLQ which is absolutely not good when I'm trying to get message redelivered infinitely in case of problem (code crash, I don't want to try another message when ordering is important)
* Using CACHE_CONSUMER, if I see what's going on, shares the session between all consumers. When one crash, session is closed and all other consumer gets a session-closed-exception
* Not using CACHE_CONSUMER: when a MessageListener throws an exception, JmsTransactionManager tells "Rolling back transactions", but message isn't redelivered anyway...
* I don't have a J2EE application server under the hand, so can't use JtaTransactionManagement...
Pfff, not not clear....
((