【发布时间】:2014-10-24 03:02:04
【问题描述】:
我有两个 int-http:inbound-gateway,路径如下所述。当我调用时
http://localhost:8080/XYZ/ABCService/query -- i expected to call http:inbound-gateway with id ="XYZ"
http://localhost:8080/ABCService/query - i expected to call http:inbound-gateway with id ="default"
但是当我向http://localhost:8080/XYZ/ABCService/query 提出请求时,它的不一致发生了什么
它正在调用“默认”网关。我理解它是因为路径/*服务。但我想知道我可以给出一些顺序或优先级或某种 url 映射说总是先检查“XYZ”然后检查“默认”
我正在使用 DispatcherServlet。
<int-http:inbound-gateway id="default"
path="/*Service/query"
request-channel="RequestChannel" reply-channel="ResponseChannel"
supported-methods="POST" reply-timeout="5000" request-payload-type="java.lang.String"
error-channel="ErrorChannel" mapped-request-headers="xyz-*, HTTP_REQUEST_HEADERS">
</int-http:inbound-gateway>
<int-http:inbound-gateway id="XYZ"
path="/XYZ/*Service/query"
request-channel="RequestChannel" reply-channel="XYZResponseChannel"
supported-methods="POST" reply-timeout="5000" request-payload-type="java.lang.String"
error-channel="ErrorChannel" mapped-request-headers="xyz-*, HTTP_REQUEST_HEADERS">
<int-http:header name="reply-type" expression="'ABC'" />
</int-http:inbound-gateway>
<int:channel id="ResponseChannel">
</int:channel>
<int:header-value-router input-channel="ResponseChannel"
header-name="reply-type">
<int:mapping value="ABC" channel="XYZResponseChannel" />
</int:header-value-router>
【问题讨论】:
标签: spring-mvc spring-integration