【发布时间】:2013-12-31 15:23:35
【问题描述】:
我想使用输入通道的负载平衡来修改(添加/删除)出站网关列表。我的代码:
<int:channel id="mainRequestChannel" />
<int-http:outbound-gateway request-channel="mainRequestChannel" message-converters="messageConverters"
request-factory="httpRequestFactory" url="http://localhost:8100/batchfactory-slave/receiveGateway"
http-method="POST" expected-response-type="JobLaunchingResponse" order="1" reply-channel="finishedResponse" />
<int-http:outbound-gateway request-channel="mainRequestChannel" message-converters="messageConverters"
request-factory="httpRequestFactory" url="http://localhost:8090/batchfactory-slave/receiveGateway"
http-method="POST" expected-response-type="JobLaunchingResponse" order="2" reply-channel="finishedResponse" />
我对此进行了修改,现在我有了一个 dynamicRouter :
<int:channel id="mainRequestChannel" />
<int:router input-channel="mainRequestChannel" expression="@dynamicChannelResolver.resolve()"/>
但 mainRequestChannel 只有 1 个订阅者,因此默认行为的负载均衡器不起作用。
感谢您的帮助。
【问题讨论】: