Spring Integration provides an "httpinvoker" namespace and schema definition. To include it in your configuration, simply provide the following URI within a namespace declaration: 'http://www.springframework.org/schema/integration/httpinvoker'. The schema location should then map to 'http://www.springframework.org/schema/integration/httpinvoker/spring-integration-httpinvoker-1.0.xsd'.
To configure the inbound gateway you can choose to use the namespace support for it. The following code snippet shows the different configuration options that are supported.
<httpinvoker:inbound-gateway id="inboundGateway" request-channel="requestChannel" request-timeout="10000" expect-reply="false" reply-timeout="30000"/>
Note | |
---|---|
A 'reply-channel' may also be provided, but it is recommended to rely on the temporary anonymous channel that will be created automatically for handling replies. |
To configure the outbound gateway you can use the namespace support as well. The following code snippet shows the different configuration for an outbound HttpInvoker gateway. Only the 'url' and 'request-channel' are required.
<httpinvoker:outbound-gateway id="outboundGateway" url="http://localhost:8080/example" request-channel="requestChannel" request-timeout="5000" reply-channel="replyChannel" reply-timeout="10000"/>