私のアプリケーションは、2 つの Web サービスのいずれかを使用できます。WS A と WS B と呼びましょう。どちらにも同じインターフェイスが含まれています。
HTTP ヘッダーとリクエスト チャネルでいくつかのロジックを実行したいと考えています。WS B は、特定の要求チャネルでのみ使用する必要があります。使用するチャネルを決定するために、リクエスト チャネルを文字列パラメータとして受け取る Java クラスを作成しました。
<http:outbound-gateway request-channel="XXXXX"
url-expression="'${EL EXP}'" http-method="GET"
extract-request-payload="true" expected-response-type="java.lang.String"
charset="UTF-8" reply-timeout="3000" reply-channel="XXXXX">
</http:outbound-gateway>
次に、コンテキストが初期化されるときに url-expression が評価されることを読みました。
<int-http:outbound-gateway request-channel="requestChannel"
url="dummy"
http-method="GET" extract-request-payload="true" expected-response-type="java.lang.String"
charset="UTF-8" reply-timeout="3000" reply-channel="sysLoggerRequestChannel">
<int-http:uri-variable name="teststring" expression="test"/>
<int-http:uri-variable name="url" expression="evalClass.getDestinationForChannel(teststring)"/>
</int-http:outbound-gateway>
このアプローチの問題点は、int-http:uri-variable 内の式が評価されていないように見えることです。
これらすべてが、私が間違ったアプローチを取っていると信じさせます。どんな助けでも大歓迎です。