Spring integration Spring集成HTTP

Spring integration Spring集成HTTP,spring-integration,Spring Integration,Spring集成HTTP支持。 您好,我正在尝试基于路径属性的通道路由。 例如,如果配置如下所示 我想根据path=“gateway/search”值将消息发送到不同的频道。查看了基于报头的路由和payloadtype路由。你能建议一下实施的方法吗 <!-- Inbound/Outbound Channels --> <int:channel id="ServiceSearchRequest" /> <int:channel id="ServiceSearchRes

Spring集成HTTP支持。 您好,我正在尝试基于路径属性的通道路由。 例如,如果配置如下所示

我想根据path=“gateway/search”值将消息发送到不同的频道。查看了基于报头的路由和payloadtype路由。你能建议一下实施的方法吗

<!-- Inbound/Outbound Channels -->
<int:channel id="ServiceSearchRequest" />
<int:channel id="ServiceSearchResponse" />


<int-http:inbound-gateway id="inboundEmployeeSearchRequestGateway"
    supported-methods="GET, POST" request-channel="ServiceSearchRequest"
    reply-channel="ServiceSearchResponse"
    mapped-response-headers="Content-Type" 
    path="ieg/Service/search" request-payload-type="java.lang.String"
    reply-timeout="5000">
</int-http:inbound-gateway>

<int-http:outbound-gateway request-channel="ServiceSearchRequest"
    reply-channel="ServiceSearchResponse"
    url="http://localhost:8080/proj/Service/avgWaitTime123.json"
    http-method="POST" expected-response-type="java.lang.String"
    mapped-response-headers="Content-Type"  />



不清楚你想要什么;您只有一个
路径
ieg/dataService/search
),因此如果您在该路径上路由,则所有消息都将转到单个通道

如果您的意思是希望基于某个查询字符串参数
。?foo=bar
,则可以向入站网关添加
元素以将其捕获为标头;e、 g

<int-http:header name="foo" expression="#requestParams.foo.get(0)" />

然后可以使用头值路由器。有关标题表达式可用的变量的完整列表,请参阅(向下滚动至
URI模板变量和表达式