mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
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:
parent
1c0bcc13cf
commit
38cca9c1f3
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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.config.JmsListenerConfigUtils;
|
||||||
import org.springframework.jms.support.destination.DestinationResolver;
|
import org.springframework.jms.support.destination.DestinationResolver;
|
||||||
import org.springframework.jms.support.destination.JndiDestinationResolver;
|
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.
|
* Configuration for Spring 4.1 annotation driven JMS.
|
||||||
@ -46,7 +46,7 @@ class JmsAnnotationDrivenConfiguration {
|
|||||||
private DestinationResolver destinationResolver;
|
private DestinationResolver destinationResolver;
|
||||||
|
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private PlatformTransactionManager transactionManager;
|
private JtaTransactionManager transactionManager;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JmsProperties properties;
|
private JmsProperties properties;
|
||||||
|
Loading…
Reference in New Issue
Block a user