メッセージヘッダーに基づいて動的 URL に http 要求を送信するには...
次のようにメッセージヘッダーからurl値を設定しようとしています:
<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']" />
しかし、これは機能していません。
どうやら{outboundGatewayUrl}
値はまったく置き換えられていません。これは、を実際の URL
に置き換えると機能します。{outboundGatewayUrl}
エラーメッセージ:
Caused by:
org.springframework.integration.MessageHandlingException: 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.SimpleClientHttpRequestFactory.createRequest(SimpleClientHttpRequestFactory.java:109)
ここで何が欠けていますか?