In order to send http request to dynamic urls based on message headers...
I am trying to set the url value from Message header as follows:
<int-http:outbound-gateway id="httpOutboundGateway" request-channel="fromMyQueue"
url="{outboundGatewayUrl}" reply-channel="nullChannel"
http-method="POST" expected-response-type="java.lang.String" charset="UTF-8">
<int-http:uri-variable name="outboundGatewayUrl" expression="headers['X-CUSTOM-HTTP-REQUEST-URL']" />
But this is not working.
Apparently {outboundGatewayUrl} value is not being replaced i.e evaluated at all Or is my understanding of the issue not right?
This works if i replace the {outboundGatewayUrl} with actual URL.
Error Message:
Caused by:
org.springframework.integration.MessageHandlingExc eption: HTTP request execution failed for URI [{outboundGatewayUrl}]...
Caused by:<br> java.lang.IllegalArgumentException: URI is not absolute
at java.net.URI.toURL(URI.java:1080)
at org.springframework.http.client.SimpleClientHttpRe questFactory.createRequest(SimpleClientHttpRequest Factory.java:109)
What am i missing here?


Reply With Quote
