INT-1729 added error-channel suport for WS inbound-gateway
This commit is contained in:
@@ -14,13 +14,15 @@
|
||||
|
||||
<si:message-history/>
|
||||
|
||||
<ws:inbound-gateway id="simple" request-channel="requestsVerySimple" />
|
||||
<ws:inbound-gateway id="simple" request-channel="requestsVerySimple" error-channel="customErrorChannel"/>
|
||||
|
||||
<si:channel id="customErrorChannel"/>
|
||||
|
||||
<si:channel id="requestsVerySimple"></si:channel>
|
||||
|
||||
<ws:inbound-gateway id="extractsPayload" request-channel="requestsSimple" extract-payload="false"/>
|
||||
|
||||
<ws:inbound-gateway id="marshalling" request-channel="requestsMarshalling"
|
||||
<ws:inbound-gateway id="marshalling" request-channel="requestsMarshalling" error-channel="customErrorChannel"
|
||||
marshaller="marshaller" unmarshaller="marshaller" />
|
||||
|
||||
<si:channel id="requestsMarshalling">
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.MessageHeaders;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.gateway.MessagingGatewaySupport;
|
||||
import org.springframework.integration.history.MessageHistory;
|
||||
import org.springframework.integration.mapping.HeaderMapper;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
@@ -71,6 +72,10 @@ public class WebServiceInboundGatewayParserTests {
|
||||
@Qualifier("requestsSimple")
|
||||
PollableChannel requestsSimple;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("customErrorChannel")
|
||||
MessageChannel customErrorChannel;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("requestsVerySimple")
|
||||
MessageChannel requestsVerySimple;
|
||||
@@ -91,6 +96,10 @@ public class WebServiceInboundGatewayParserTests {
|
||||
assertThat(
|
||||
(MessageChannel) accessor.getPropertyValue("requestChannel"),
|
||||
is(requestsVerySimple));
|
||||
|
||||
assertThat(
|
||||
(MessageChannel) accessor.getPropertyValue("errorChannel"),
|
||||
is(customErrorChannel));
|
||||
}
|
||||
|
||||
//extractPayload = false
|
||||
@@ -121,6 +130,12 @@ public class WebServiceInboundGatewayParserTests {
|
||||
assertThat((AbstractMarshaller) accessor.getPropertyValue("unmarshaller"),
|
||||
is(marshaller));
|
||||
assertTrue("messaging gateway is not running", marshallingGateway.isRunning());
|
||||
|
||||
MessagingGatewaySupport mgs = (MessagingGatewaySupport) accessor.getPropertyValue("gatewayDelegate");
|
||||
DirectFieldAccessor mgsAccessor = new DirectFieldAccessor(mgs);
|
||||
assertThat(
|
||||
(MessageChannel) mgsAccessor.getPropertyValue("errorChannel"),
|
||||
is(customErrorChannel));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user