Rework more JMS tests to common CF resource
* Refactor STOMP and WebSocket tests into JUnit 5 * Close a server application context in those tests when Tomcat is destroyed
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd">
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<int:channel id="outboundChannel"/>
|
||||
|
||||
@@ -32,14 +34,8 @@
|
||||
<bean id="extractRecRepQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="request.queue.req.rep"/>
|
||||
</bean>
|
||||
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
<property name="trustAllPackages" value="true"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="sessionCacheSize" value="10"/>
|
||||
<property name="cacheProducers" value="false"/>
|
||||
</bean>
|
||||
|
||||
<util:constant id="jmsConnectionFactory"
|
||||
static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.connectionFactory"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -23,14 +23,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import javax.jms.JMSException;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.integration.core.MessagingTemplate;
|
||||
import org.springframework.integration.jms.ActiveMQMultiContextTests;
|
||||
import org.springframework.integration.jms.ChannelPublishingJmsMessageListener;
|
||||
import org.springframework.integration.jms.JmsOutboundGateway;
|
||||
import org.springframework.messaging.Message;
|
||||
@@ -40,21 +39,17 @@ import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.messaging.SubscribableChannel;
|
||||
import org.springframework.messaging.support.GenericMessage;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
/**
|
||||
* @author ozhurakousky
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gunnar Hillert
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringJUnitConfig
|
||||
@DirtiesContext
|
||||
public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
@Rule
|
||||
public TestName testName = new TestName();
|
||||
public class ExtractRequestReplyPayloadTests extends ActiveMQMultiContextTests {
|
||||
|
||||
@Autowired
|
||||
ApplicationContext applicationContext;
|
||||
@@ -75,7 +70,7 @@ public class ExtractRequestReplyPayloadTests {
|
||||
ChannelPublishingJmsMessageListener inboundGateway;
|
||||
|
||||
@Test
|
||||
public void testOutboundInboundDefault() {
|
||||
public void testOutboundInboundDefault(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(true);
|
||||
this.outboundGateway.setExtractReplyPayload(true);
|
||||
|
||||
@@ -84,15 +79,15 @@ public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
MessageHandler handler = echoInboundStringHandler();
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload() instanceof String).isTrue();
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(String.class);
|
||||
this.jmsInputChannel.unsubscribe(handler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutboundInboundDefaultIsTx() {
|
||||
public void testOutboundInboundDefaultIsTx(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(true);
|
||||
this.outboundGateway.setExtractReplyPayload(true);
|
||||
|
||||
@@ -110,15 +105,15 @@ public class ExtractRequestReplyPayloadTests {
|
||||
template.send(message);
|
||||
};
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload() instanceof String).isTrue();
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(String.class);
|
||||
this.jmsInputChannel.unsubscribe(handler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutboundBothFalseInboundDefault() {
|
||||
public void testOutboundBothFalseInboundDefault(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(false);
|
||||
this.outboundGateway.setExtractReplyPayload(false);
|
||||
|
||||
@@ -127,7 +122,7 @@ public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
MessageHandler handler = echoInboundStringHandler();
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(javax.jms.TextMessage.class);
|
||||
@@ -135,7 +130,7 @@ public class ExtractRequestReplyPayloadTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutboundDefaultInboundBothFalse() throws Exception {
|
||||
public void testOutboundDefaultInboundBothFalse(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(true);
|
||||
this.outboundGateway.setExtractReplyPayload(true);
|
||||
|
||||
@@ -144,14 +139,14 @@ public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
MessageHandler handler = unwrapTextMessageAndEchoHandler();
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(String.class);
|
||||
this.jmsInputChannel.unsubscribe(handler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutboundDefaultInboundReplyTrueRequestFalse() {
|
||||
public void testOutboundDefaultInboundReplyTrueRequestFalse(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(true);
|
||||
this.outboundGateway.setExtractReplyPayload(true);
|
||||
|
||||
@@ -160,14 +155,14 @@ public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
MessageHandler handler = unwrapTextMessageAndEchoHandler();
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(String.class);
|
||||
this.jmsInputChannel.unsubscribe(handler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutboundDefaultInboundReplyFalseRequestTrue() {
|
||||
public void testOutboundDefaultInboundReplyFalseRequestTrue(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(true);
|
||||
this.outboundGateway.setExtractReplyPayload(true);
|
||||
|
||||
@@ -176,14 +171,14 @@ public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
MessageHandler handler = echoInboundStringHandler();
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload() instanceof String).isTrue();
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(String.class);
|
||||
this.jmsInputChannel.unsubscribe(handler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutboundRequestTrueReplyFalseInboundDefault() {
|
||||
public void testOutboundRequestTrueReplyFalseInboundDefault(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(true);
|
||||
this.outboundGateway.setExtractReplyPayload(false);
|
||||
|
||||
@@ -192,14 +187,14 @@ public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
MessageHandler handler = echoInboundStringHandler();
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload() instanceof javax.jms.Message).isTrue();
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(javax.jms.Message.class);
|
||||
this.jmsInputChannel.unsubscribe(handler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutboundRequestFalseReplyTrueInboundDefault() {
|
||||
public void testOutboundRequestFalseReplyTrueInboundDefault(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(false);
|
||||
this.outboundGateway.setExtractReplyPayload(true);
|
||||
|
||||
@@ -208,14 +203,14 @@ public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
MessageHandler handler = echoInboundStringHandler();
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(String.class);
|
||||
this.jmsInputChannel.unsubscribe(handler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFalse() throws Exception {
|
||||
public void testAllFalse(TestInfo testInfo) {
|
||||
this.outboundGateway.setExtractRequestPayload(false);
|
||||
this.outboundGateway.setExtractReplyPayload(false);
|
||||
|
||||
@@ -224,7 +219,7 @@ public class ExtractRequestReplyPayloadTests {
|
||||
|
||||
MessageHandler handler = unwrapObjectMessageAndEchoHandler();
|
||||
this.jmsInputChannel.subscribe(handler);
|
||||
this.outboundChannel.send(new GenericMessage<String>("Hello " + this.testName.getMethodName()));
|
||||
this.outboundChannel.send(new GenericMessage<>("Hello " + testInfo.getDisplayName()));
|
||||
Message<?> replyMessage = this.replyChannel.receive(10000);
|
||||
assertThat(replyMessage.getPayload()).isInstanceOf(javax.jms.Message.class);
|
||||
this.jmsInputChannel.unsubscribe(handler);
|
||||
@@ -267,7 +262,7 @@ public class ExtractRequestReplyPayloadTests {
|
||||
catch (JMSException e) {
|
||||
fail("failed to deserialize message");
|
||||
}
|
||||
template.send(new GenericMessage<String>(payload));
|
||||
template.send(new GenericMessage<>(payload));
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:jms="http://www.springframework.org/schema/jms"
|
||||
xmlns:task="http://www.springframework.org/schema/task"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/jms https://www.springframework.org/schema/jms/spring-jms.xsd
|
||||
http://www.springframework.org/schema/task https://www.springframework.org/schema/task/spring-task.xsd">
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<int-jms:message-driven-channel-adapter channel="jmsInputChannel" container="container"/>
|
||||
|
||||
<int-jms:message-driven-channel-adapter channel="jmsInputChannel" destination="queueB" error-channel="testErrorChannel"/>
|
||||
<int-jms:message-driven-channel-adapter channel="jmsInputChannel" destination="queueB"
|
||||
error-channel="testErrorChannel"/>
|
||||
|
||||
<int:service-activator input-channel="jmsInputChannel">
|
||||
<bean id="testService" class="org.springframework.integration.jms.config.InboundOneWayErrorTests$TestService"/>
|
||||
@@ -23,7 +22,7 @@
|
||||
<int:queue/>
|
||||
</int:channel>
|
||||
|
||||
<bean id="queueA" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<bean id="queueA" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="oneway.a"/>
|
||||
</bean>
|
||||
|
||||
@@ -37,16 +36,10 @@
|
||||
<property name="errorHandler" ref="testErrorHandler"/>
|
||||
</bean>
|
||||
|
||||
<bean id="testErrorHandler" class="org.springframework.integration.jms.config.InboundOneWayErrorTests$TestErrorHandler"/>
|
||||
<bean id="testErrorHandler"
|
||||
class="org.springframework.integration.jms.config.InboundOneWayErrorTests$TestErrorHandler"/>
|
||||
|
||||
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="sessionCacheSize" value="10"/>
|
||||
<property name="cacheProducers" value="false"/>
|
||||
</bean>
|
||||
<util:constant id="jmsConnectionFactory"
|
||||
static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.connectionFactory"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -24,28 +24,36 @@ import java.util.concurrent.TimeUnit;
|
||||
import javax.jms.ConnectionFactory;
|
||||
import javax.jms.Destination;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.integration.jms.ActiveMQMultiContextTests;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.jms.core.MessageCreator;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHandlingException;
|
||||
import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
import org.springframework.util.ErrorHandler;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
public class InboundOneWayErrorTests {
|
||||
@SpringJUnitConfig
|
||||
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
|
||||
public class InboundOneWayErrorTests extends ActiveMQMultiContextTests {
|
||||
|
||||
@Autowired
|
||||
ApplicationContext context;
|
||||
|
||||
@Test
|
||||
public void noErrorChannel() throws Exception {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("InboundOneWayErrorTests-context.xml", getClass());
|
||||
JmsTemplate jmsTemplate = new JmsTemplate(context.getBean("jmsConnectionFactory", ConnectionFactory.class));
|
||||
Destination queue = context.getBean("queueA", Destination.class);
|
||||
jmsTemplate.send(queue, (MessageCreator) session -> session.createTextMessage("test-A"));
|
||||
jmsTemplate.send(queue, session -> session.createTextMessage("test-A"));
|
||||
TestErrorHandler errorHandler = context.getBean("testErrorHandler", TestErrorHandler.class);
|
||||
errorHandler.latch.await(3000, TimeUnit.MILLISECONDS);
|
||||
assertThat(errorHandler.lastError).isNotNull();
|
||||
@@ -53,15 +61,13 @@ public class InboundOneWayErrorTests {
|
||||
assertThat(errorHandler.lastError.getCause().getMessage()).isEqualTo("failed to process: test-A");
|
||||
PollableChannel testErrorChannel = context.getBean("testErrorChannel", PollableChannel.class);
|
||||
assertThat(testErrorChannel.receive(0)).isNull();
|
||||
context.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void errorChannel() throws Exception {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("InboundOneWayErrorTests-context.xml", getClass());
|
||||
public void errorChannel() {
|
||||
JmsTemplate jmsTemplate = new JmsTemplate(context.getBean("jmsConnectionFactory", ConnectionFactory.class));
|
||||
Destination queue = context.getBean("queueB", Destination.class);
|
||||
jmsTemplate.send(queue, (MessageCreator) session -> session.createTextMessage("test-B"));
|
||||
jmsTemplate.send(queue, session -> session.createTextMessage("test-B"));
|
||||
PollableChannel errorChannel = context.getBean("testErrorChannel", PollableChannel.class);
|
||||
Message<?> errorMessage = errorChannel.receive(3000);
|
||||
assertThat(errorMessage).isNotNull();
|
||||
@@ -72,22 +78,25 @@ public class InboundOneWayErrorTests {
|
||||
assertThat(exception.getCause().getMessage()).isEqualTo("failed to process: test-B");
|
||||
TestErrorHandler errorHandler = context.getBean("testErrorHandler", TestErrorHandler.class);
|
||||
assertThat(errorHandler.lastError).isNull();
|
||||
context.close();
|
||||
}
|
||||
|
||||
|
||||
public static class TestService {
|
||||
|
||||
public void process(Object o) {
|
||||
throw new TestException("failed to process: " + o);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class TestException extends RuntimeException {
|
||||
|
||||
TestException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TestErrorHandler implements ErrorHandler {
|
||||
@@ -101,6 +110,7 @@ public class InboundOneWayErrorTests {
|
||||
this.lastError = t;
|
||||
this.latch.countDown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<int:message-history/>
|
||||
|
||||
@@ -21,14 +23,7 @@
|
||||
<constructor-arg value="request.queue."/>
|
||||
</bean>
|
||||
|
||||
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
<property name="trustAllPackages" value="true"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="sessionCacheSize" value="10"/>
|
||||
<property name="cacheProducers" value="false"/>
|
||||
</bean>
|
||||
<util:constant id="jmsConnectionFactory"
|
||||
static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.connectionFactory"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -25,9 +25,10 @@ import static org.mockito.Mockito.verify;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.integration.history.MessageHistory;
|
||||
import org.springframework.integration.jms.ActiveMQMultiContextTests;
|
||||
import org.springframework.integration.jms.SubscribableJmsChannel;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.jms.listener.AbstractMessageListenerContainer;
|
||||
@@ -35,6 +36,8 @@ import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.messaging.SubscribableChannel;
|
||||
import org.springframework.messaging.support.GenericMessage;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -42,7 +45,12 @@ import org.springframework.messaging.support.GenericMessage;
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
public class JmsChannelHistoryTests {
|
||||
@SpringJUnitConfig
|
||||
@DirtiesContext
|
||||
public class JmsChannelHistoryTests extends ActiveMQMultiContextTests {
|
||||
|
||||
@Autowired
|
||||
ApplicationContext context;
|
||||
|
||||
@Test
|
||||
public void testMessageHistory() {
|
||||
@@ -66,16 +74,12 @@ public class JmsChannelHistoryTests {
|
||||
|
||||
@Test
|
||||
public void testFullConfig() {
|
||||
try (ConfigurableApplicationContext ac =
|
||||
new ClassPathXmlApplicationContext("JmsChannelHistoryTests-context.xml", this.getClass())) {
|
||||
|
||||
SubscribableChannel channel = ac.getBean("jmsChannel", SubscribableChannel.class);
|
||||
PollableChannel resultChannel = ac.getBean("resultChannel", PollableChannel.class);
|
||||
channel.send(new GenericMessage<>("hello"));
|
||||
Message<?> resultMessage = resultChannel.receive(10000);
|
||||
MessageHistory history = MessageHistory.read(resultMessage);
|
||||
assertThat(history.get(0).contains("jmsChannel")).isTrue();
|
||||
}
|
||||
SubscribableChannel channel = context.getBean("jmsChannel", SubscribableChannel.class);
|
||||
PollableChannel resultChannel = context.getBean("resultChannel", PollableChannel.class);
|
||||
channel.send(new GenericMessage<>("hello"));
|
||||
Message<?> resultMessage = resultChannel.receive(10000);
|
||||
MessageHistory history = MessageHistory.read(resultMessage);
|
||||
assertThat(history.get(0).contains("jmsChannel")).isTrue();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/jms https://www.springframework.org/schema/jms/spring-jms.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
|
||||
http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<context:property-placeholder location="classpath:org/springframework/integration/jms/config/channel.properties"/>
|
||||
|
||||
@@ -63,9 +64,8 @@
|
||||
<bean id="destinationResolver"
|
||||
class="org.springframework.integration.jms.config.JmsChannelParserTests$TestDestinationResolver"/>
|
||||
|
||||
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
<util:constant id="jmsConnectionFactory"
|
||||
static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.amqFactory"/>
|
||||
|
||||
<alias name="jmsConnectionFactory" alias="connFact"/>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -27,11 +27,11 @@ import javax.jms.Queue;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.Topic;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.integration.jms.ActiveMQMultiContextTests;
|
||||
import org.springframework.integration.jms.PollableJmsChannel;
|
||||
import org.springframework.integration.jms.SubscribableJmsChannel;
|
||||
import org.springframework.integration.support.MessageBuilderFactory;
|
||||
@@ -44,17 +44,16 @@ import org.springframework.jms.support.destination.DestinationResolver;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.support.ChannelInterceptor;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringJUnitConfig
|
||||
@DirtiesContext
|
||||
public class JmsChannelParserTests {
|
||||
public class JmsChannelParserTests extends ActiveMQMultiContextTests {
|
||||
|
||||
@Autowired
|
||||
private MessageChannel queueReferenceChannel;
|
||||
@@ -125,7 +124,8 @@ public class JmsChannelParserTests {
|
||||
SubscribableJmsChannel channel = (SubscribableJmsChannel) queueReferenceChannel;
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(channel);
|
||||
JmsTemplate jmsTemplate = (JmsTemplate) accessor.getPropertyValue("jmsTemplate");
|
||||
AbstractMessageListenerContainer container = (AbstractMessageListenerContainer) accessor.getPropertyValue("container");
|
||||
AbstractMessageListenerContainer container =
|
||||
(AbstractMessageListenerContainer) accessor.getPropertyValue("container");
|
||||
assertThat(jmsTemplate.getDefaultDestination()).isEqualTo(queue);
|
||||
assertThat(container.getDestination()).isEqualTo(queue);
|
||||
assertThat(TestUtils.getPropertyValue(jmsTemplate, "explicitQosEnabled")).isEqualTo(true);
|
||||
@@ -336,10 +336,12 @@ public class JmsChannelParserTests {
|
||||
}
|
||||
return pubSubDomain ? topic : queue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static class TestInterceptor implements ChannelInterceptor {
|
||||
|
||||
}
|
||||
|
||||
static class CustomTestMessageListenerContainer extends DefaultMessageListenerContainer {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -31,6 +31,7 @@ import org.springframework.beans.factory.BeanDefinitionStoreException;
|
||||
import org.springframework.context.SmartLifecycle;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.history.MessageHistory;
|
||||
import org.springframework.integration.jms.ActiveMQMultiContextTests;
|
||||
import org.springframework.integration.jms.JmsMessageDrivenEndpoint;
|
||||
import org.springframework.integration.support.SmartLifecycleRoleController;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
@@ -48,7 +49,7 @@ import org.springframework.util.MultiValueMap;
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
public class JmsInboundGatewayParserTests {
|
||||
public class JmsInboundGatewayParserTests extends ActiveMQMultiContextTests {
|
||||
|
||||
@Test
|
||||
public void testGatewayWithConnectionFactoryAndDestination() {
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms">
|
||||
|
||||
<int:gateway id="sampleGateway" default-request-channel="channel-a" service-interface="org.springframework.integration.jms.config.JmsMessageHistoryTests.SampleGateway"/>
|
||||
|
||||
<int:publish-subscribe-channel id="channel-a"/>
|
||||
|
||||
<int-jms:outbound-gateway id="jmsOutbound" request-channel="channel-a" request-destination-name="request.queue_b" header-mapper="headerMapper"/>
|
||||
|
||||
|
||||
<int-jms:inbound-gateway id="jmsInbound" request-channel="inbound-jms-channel" request-destination-name="request.queue_b" header-mapper="headerMapper"/>
|
||||
|
||||
<int:publish-subscribe-channel id="inbound-jms-channel"/>
|
||||
|
||||
<int:service-activator id="sampleService-a" input-channel="inbound-jms-channel">
|
||||
<bean class="org.springframework.integration.jms.config.JmsMessageHistoryTests.SampleService"/>
|
||||
</int:service-activator>
|
||||
|
||||
<bean id="historyWriter" class="org.springframework.integration.history.MessageHistoryWriter"/>
|
||||
|
||||
<bean id="headerMapper" class="org.springframework.integration.jms.config.JmsMessageHistoryTests$SampleHeaderMapper"/>
|
||||
|
||||
<int:poller id="poller" default="true">
|
||||
<int:interval-trigger interval="10"/>
|
||||
</int:poller>
|
||||
|
||||
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="sessionCacheSize" value="10"/>
|
||||
<property name="cacheProducers" value="false"/>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/jms https://www.springframework.org/schema/jms/spring-jms.xsd
|
||||
http://www.springframework.org/schema/task https://www.springframework.org/schema/task/spring-task.xsd"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:jms="http://www.springframework.org/schema/jms"
|
||||
xmlns:task="http://www.springframework.org/schema/task">
|
||||
|
||||
<int:channel id="outbound-channel"/>
|
||||
|
||||
<int-jms:outbound-channel-adapter id="jmsOutbound" channel="outbound-channel" destination-name="request.queue_a" header-mapper="headerMapper"/>
|
||||
|
||||
|
||||
<int-jms:inbound-channel-adapter id="sampleJmsInboundAdapter" channel="jmsInputChannel" destination-name="request.queue_a" header-mapper="headerMapper"/>
|
||||
|
||||
<int:channel id="jmsInputChannel">
|
||||
<int:queue capacity="2"/>
|
||||
</int:channel>
|
||||
|
||||
<int:poller id="poller" default="true">
|
||||
<int:interval-trigger interval="10"/>
|
||||
</int:poller>
|
||||
|
||||
<bean id="headerMapper" class="org.springframework.integration.jms.config.JmsMessageHistoryTests$SampleHeaderMapper"/>
|
||||
|
||||
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="sessionCacheSize" value="10"/>
|
||||
<property name="cacheProducers" value="false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="historyWriter" class="org.springframework.integration.history.MessageHistoryWriter"/>
|
||||
</beans>
|
||||
@@ -1,11 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms">
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<int:message-history/>
|
||||
|
||||
@@ -68,16 +70,8 @@
|
||||
<constructor-arg value="reply.queueB"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="sessionCacheSize" value="10"/>
|
||||
<property name="cacheProducers" value="false"/>
|
||||
</bean>
|
||||
<util:constant id="jmsConnectionFactory"
|
||||
static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.connectionFactory"/>
|
||||
|
||||
<int-jms:inbound-gateway id="inboundGateway" request-channel="jmsInput" request-destination="requestQueueA"/>
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:si="http://www.springframework.org/schema/integration"
|
||||
xmlns:jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:si="http://www.springframework.org/schema/integration"
|
||||
xmlns:jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration
|
||||
https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms
|
||||
https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd">
|
||||
https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<si:channel id="requests"/>
|
||||
|
||||
@@ -29,12 +31,8 @@
|
||||
<bean id="testReplyDestination" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="testReplyDestination"/>
|
||||
</bean>
|
||||
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<util:constant id="jmsConnectionFactory"
|
||||
static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.amqFactory"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd">
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<int:gateway id="explicitCorrelationKeyGateway" default-request-channel="explicitCorrelationIn"/>
|
||||
|
||||
@@ -93,15 +96,7 @@
|
||||
<bean class="org.springframework.integration.jms.request_reply.RequestReplyScenariosWithCorrelationKeyProvidedTests.DelayedService"/>
|
||||
</int:transformer>
|
||||
|
||||
<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="cacheProducers" value="true" />
|
||||
<property name="cacheConsumers" value="true" />
|
||||
<property name="sessionCacheSize" value="10" />
|
||||
</bean>
|
||||
<util:constant id="jmsConnectionFactory"
|
||||
static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.amqFactory"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/jms https://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<int:gateway default-request-channel="in" default-request-timeout="20000" default-reply-timeout="20000"/>
|
||||
|
||||
@@ -28,14 +30,7 @@
|
||||
<int:transformer expression="payload"/>
|
||||
</int:chain>
|
||||
|
||||
<bean id="jmsConnectionFactory"
|
||||
class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="cacheConsumers" value="false"/>
|
||||
</bean>
|
||||
<util:constant id="jmsConnectionFactory"
|
||||
static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.amqFactory"/>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user