INT-1623 replaced 'exception-mapper' with 'error-channel' on 'gateway' and JMS 'inbound-gateway' elements

This commit is contained in:
Mark Fisher
2010-11-15 23:57:58 -05:00
parent 498fcd8c3c
commit c6d68c9e2a
11 changed files with 133 additions and 121 deletions

View File

@@ -23,16 +23,19 @@
<int-jms:inbound-gateway request-destination="requestQueueB"
request-channel="jmsinputchannel"
exception-mapper="errorMessageMapper"/>
error-channel="errorTransformationChannel"/>
<int-jms:inbound-gateway request-destination="requestQueueA"
request-channel="jmsinputchannel"/>
<int-jms:inbound-gateway request-destination="requestQueueC"
request-channel="jmsinputchannel"
exception-mapper="errorMessageMapper"/>
error-channel="errorTransformationChannel"/>
<bean id="errorMessageMapper" class="org.springframework.integration.jms.config.ExceptionHandlingSiConsumerTests$SampleErrorMessageMapper"/>
<int:transformer input-channel="errorTransformationChannel">
<bean id="errorTransformer" class="org.springframework.integration.jms.config.ExceptionHandlingSiConsumerTests$SampleErrorTransformer"/>
</int:transformer>
<int:channel id="jmsinputchannel"/>
<int:router input-channel="jmsinputchannel" expression="payload"/>

View File

@@ -30,14 +30,12 @@ import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.mapping.InboundMessageMapper;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
/**
* @author Oleg Zhurakousky
*
*/
public class ExceptionHandlingSiConsumerTests {
@@ -120,8 +118,8 @@ public class ExceptionHandlingSiConsumerTests {
}
public static class SampleErrorMessageMapper implements InboundMessageMapper<Throwable> {
public org.springframework.integration.Message<?> toMessage(Throwable t) throws Exception {
public static class SampleErrorTransformer {
public org.springframework.integration.Message<?> transform(Throwable t) throws Exception {
return MessageBuilder.withPayload(t.getCause().getMessage()).build();
}
}