Only associate JTA transaction manager to JMS factory

The JMS MessageListenerContainer supports the PlatformTransactionManager
abstraction with either a `JmsTransactionManager` for local transactions
or `JtaTransactionManager` for distributed transactions. The former is
kind of deprecated (`setTransacted` should be used instead). In any case,
any other `PlatformTransactionManager` implementation is not supported.

Update JmsAnnotationDrivenConfiguration to only associated a JTA
transaction manager, if any.

Closes gh-3150
This commit is contained in:
Stephane Nicoll 2015-06-08 15:06:14 +02:00
parent 1c0bcc13cf
commit 38cca9c1f3

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2014 the original author or authors.
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -29,7 +29,7 @@ import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.config.JmsListenerConfigUtils;
import org.springframework.jms.support.destination.DestinationResolver;
import org.springframework.jms.support.destination.JndiDestinationResolver;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.jta.JtaTransactionManager;
/**
* Configuration for Spring 4.1 annotation driven JMS.
@ -46,7 +46,7 @@ class JmsAnnotationDrivenConfiguration {
private DestinationResolver destinationResolver;
@Autowired(required = false)
private PlatformTransactionManager transactionManager;
private JtaTransactionManager transactionManager;
@Autowired
private JmsProperties properties;