INT-1341
This commit is contained in:
@@ -18,10 +18,17 @@
|
||||
|
||||
<int:channel id="outbound-channel"/>
|
||||
|
||||
<int-jms:outbound-gateway request-channel="outbound-channel" request-destination="requestQueue"/>
|
||||
<int-jms:outbound-gateway request-channel="outbound-channel" request-destination="requestQueueC"/>
|
||||
|
||||
|
||||
<int-jms:inbound-gateway request-destination="requestQueue"
|
||||
<int-jms:inbound-gateway request-destination="requestQueueB"
|
||||
request-channel="jmsinputchannel"
|
||||
exception-mapper="errorMessageMapper"/>
|
||||
|
||||
<int-jms:inbound-gateway request-destination="requestQueueA"
|
||||
request-channel="jmsinputchannel"/>
|
||||
|
||||
<int-jms:inbound-gateway request-destination="requestQueueC"
|
||||
request-channel="jmsinputchannel"
|
||||
exception-mapper="errorMessageMapper"/>
|
||||
|
||||
@@ -41,16 +48,24 @@
|
||||
<bean class="org.springframework.integration.jms.config.ExceptionHandlingSiConsumerTests$SampleService"/>
|
||||
</int:service-activator>
|
||||
|
||||
<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="request.queue"/>
|
||||
<bean id="requestQueueA" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="request.queue.a"/>
|
||||
</bean>
|
||||
|
||||
<bean id="replyQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="reply.queue"/>
|
||||
<bean id="replyQueueA" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="reply.queue.a"/>
|
||||
</bean>
|
||||
|
||||
<bean id="replyTopic" class="org.apache.activemq.command.ActiveMQTopic">
|
||||
<constructor-arg value="reply.topic"/>
|
||||
<bean id="requestQueueB" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="request.queue.b"/>
|
||||
</bean>
|
||||
|
||||
<bean id="replyQueueB" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="reply.queue.b"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestQueueC" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="request.queue.c"/>
|
||||
</bean>
|
||||
|
||||
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||
|
||||
@@ -38,13 +38,13 @@ import org.springframework.jms.core.MessageCreator;
|
||||
*/
|
||||
public class ExceptionHandlingSiConsumerTests {
|
||||
|
||||
@Test @Ignore
|
||||
@Test
|
||||
public void nonSiProducer_siConsumer_sync_withReturn() throws Exception {
|
||||
ActiveMqTestUtils.prepare();
|
||||
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext("Exception-nonSiProducer-siConsumer.xml", ExceptionHandlingSiConsumerTests.class);
|
||||
JmsTemplate jmsTemplate = new JmsTemplate(applicationContext.getBean("connectionFactory", ConnectionFactory.class));
|
||||
Destination request = applicationContext.getBean("requestQueue", Destination.class);
|
||||
final Destination reply = applicationContext.getBean("replyQueue", Destination.class);
|
||||
Destination request = applicationContext.getBean("requestQueueA", Destination.class);
|
||||
final Destination reply = applicationContext.getBean("replyQueueA", Destination.class);
|
||||
jmsTemplate.send(request, new MessageCreator() {
|
||||
|
||||
public Message createMessage(Session session) throws JMSException {
|
||||
@@ -55,16 +55,17 @@ public class ExceptionHandlingSiConsumerTests {
|
||||
}
|
||||
});
|
||||
Message message = jmsTemplate.receive(reply);
|
||||
System.out.println(message);
|
||||
Assert.assertNotNull(message);
|
||||
applicationContext.close();
|
||||
}
|
||||
@Test @Ignore
|
||||
@Test
|
||||
public void nonSiProducer_siConsumer_sync_withReturnNoException() throws Exception {
|
||||
ActiveMqTestUtils.prepare();
|
||||
ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext("Exception-nonSiProducer-siConsumer.xml", ExceptionHandlingSiConsumerTests.class);
|
||||
JmsTemplate jmsTemplate = new JmsTemplate(applicationContext.getBean("connectionFactory", ConnectionFactory.class));
|
||||
Destination request = applicationContext.getBean("requestQueue", Destination.class);
|
||||
final Destination reply = applicationContext.getBean("replyQueue", Destination.class);
|
||||
Destination request = applicationContext.getBean("requestQueueB", Destination.class);
|
||||
final Destination reply = applicationContext.getBean("replyQueueB", Destination.class);
|
||||
jmsTemplate.send(request, new MessageCreator() {
|
||||
|
||||
public Message createMessage(Session session) throws JMSException {
|
||||
@@ -79,7 +80,7 @@ public class ExceptionHandlingSiConsumerTests {
|
||||
applicationContext.close();
|
||||
}
|
||||
|
||||
@Test @Ignore
|
||||
@Test
|
||||
public void nonSiProducer_siConsumer_sync_withOutboundGateway() throws Exception{
|
||||
ActiveMqTestUtils.prepare();
|
||||
final ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext("Exception-nonSiProducer-siConsumer.xml", ExceptionHandlingSiConsumerTests.class);
|
||||
@@ -88,7 +89,7 @@ public class ExceptionHandlingSiConsumerTests {
|
||||
System.out.println("Reply: " + reply);
|
||||
applicationContext.close();
|
||||
}
|
||||
|
||||
//
|
||||
public static class SampleService{
|
||||
public String echoWithException(String value){
|
||||
throw new SampleException("echoWithException");
|
||||
|
||||
Reference in New Issue
Block a user