Browse Source

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
pull/3241/head
Stephane Nicoll 11 years ago
parent
commit
38cca9c1f3
  1. 6
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java

6
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java

@ -1,5 +1,5 @@ @@ -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; @@ -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 { @@ -46,7 +46,7 @@ class JmsAnnotationDrivenConfiguration {
private DestinationResolver destinationResolver;
@Autowired(required = false)
private PlatformTransactionManager transactionManager;
private JtaTransactionManager transactionManager;
@Autowired
private JmsProperties properties;

Loading…
Cancel
Save