From 38cca9c1f34f582b67a93c534a48ed420bb88f37 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 8 Jun 2015 15:06:14 +0200 Subject: [PATCH] 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 --- .../autoconfigure/jms/JmsAnnotationDrivenConfiguration.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java index 33eab5779be..fe90bb87c08 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java @@ -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;