mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Disable auto-config of Narayana's JMS support when JMS module absent
Closes gh-9844
This commit is contained in:
parent
be535103a7
commit
8f877dcee2
@ -597,6 +597,11 @@
|
||||
<artifactId>jooq</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.narayana.jta</groupId>
|
||||
<artifactId>jms</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.narayana.jta</groupId>
|
||||
<artifactId>jta</artifactId>
|
||||
|
@ -23,6 +23,7 @@ import javax.transaction.TransactionManager;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import com.arjuna.ats.jbossatx.jta.RecoveryManagerService;
|
||||
import org.jboss.narayana.jta.jms.TransactionHelper;
|
||||
import org.jboss.tm.XAResourceRecoveryRegistry;
|
||||
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
@ -150,7 +151,7 @@ public class NarayanaJtaConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnClass(Message.class)
|
||||
@ConditionalOnClass({ Message.class, TransactionHelper.class })
|
||||
static class NarayanaJtaJmsConfiguration {
|
||||
|
||||
@Bean
|
||||
|
@ -31,6 +31,7 @@ import javax.transaction.TransactionManager;
|
||||
import javax.transaction.UserTransaction;
|
||||
import javax.transaction.xa.XAResource;
|
||||
|
||||
import com.arjuna.ats.jbossatx.jta.RecoveryManagerService;
|
||||
import com.atomikos.icatch.config.UserTransactionService;
|
||||
import com.atomikos.icatch.jta.UserTransactionManager;
|
||||
import com.atomikos.jms.AtomikosConnectionFactoryBean;
|
||||
@ -52,6 +53,8 @@ import org.springframework.boot.jta.atomikos.AtomikosProperties;
|
||||
import org.springframework.boot.jta.bitronix.BitronixDependentBeanFactoryPostProcessor;
|
||||
import org.springframework.boot.jta.bitronix.PoolingConnectionFactoryBean;
|
||||
import org.springframework.boot.jta.bitronix.PoolingDataSourceBean;
|
||||
import org.springframework.boot.jta.narayana.NarayanaBeanFactoryPostProcessor;
|
||||
import org.springframework.boot.jta.narayana.NarayanaConfigurationBean;
|
||||
import org.springframework.boot.test.util.EnvironmentTestUtils;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -137,6 +140,20 @@ public class JtaAutoConfigurationTests {
|
||||
this.context.getBean(JtaTransactionManager.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void narayanaSanityCheck() throws Exception {
|
||||
this.context = new AnnotationConfigApplicationContext(JtaProperties.class,
|
||||
NarayanaJtaConfiguration.class);
|
||||
this.context.getBean(NarayanaConfigurationBean.class);
|
||||
this.context.getBean(UserTransaction.class);
|
||||
this.context.getBean(TransactionManager.class);
|
||||
this.context.getBean(XADataSourceWrapper.class);
|
||||
this.context.getBean(XAConnectionFactoryWrapper.class);
|
||||
this.context.getBean(NarayanaBeanFactoryPostProcessor.class);
|
||||
this.context.getBean(JtaTransactionManager.class);
|
||||
this.context.getBean(RecoveryManagerService.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void defaultBitronixServerId() throws UnknownHostException {
|
||||
this.context = new AnnotationConfigApplicationContext(
|
||||
|
Loading…
Reference in New Issue
Block a user