【发布时间】:2015-02-03 17:47:09
【问题描述】:
我想知道我是否遗漏了与 http 入站网关相关的内容。我想使用可选参数执行搜索(结果将是 json)。以下是已定义网关的示例:
<int-http:inbound-gateway id="inboundSearchRequestGateway" supported-methods="GET, POST" request-channel="searchRequest" reply-channel="searchResults"
mapped-response-headers="Return-Status, Return-Status-Msg, HTTP_RESPONSE_HEADERS" view-name="/test123" path="/search" reply-timeout="50000"
error-channel="errorChannel">
<int-http:header name="param1" expression="#requestParams.param1"/>
<int-http:header name="param2" expression="#requestParams.param2"/>
</int-http:inbound-gateway>
目前我必须提供两个参数才能进行搜索,否则请求不会传递到请求通道。
有问题的搜索目前没有使用参数。
这将返回结果:
http://localhost/test123/search?param1=123&param2=234
虽然这不会返回任何内容:
http://localhost/test123/search?param1=123
是否有其他方法可以将请求参数映射到集成消息标头中,以便在链中进行进一步处理?这甚至可能是一个错误吗?
我正在使用 Spring Integration 4.1.2、Windows、Java 7。
谢谢。
T
【问题讨论】: