HTTP入站网关路径URL映射(http inbound gateway path url mapp

2019-10-21 04:01发布

我有两个int HTTP:入站网关与路径below.when我打电话提到

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"

但其时我给请求没有一致性什么happing http://localhost:8080/XYZ/ABCService/query它呼吁“默认” gateway.i了解,因为道路的/*Serivce.But我想知道能不能我给一些顺序或优先级或某种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>

Answer 1:

能否详细说明你真的确定,它不能正常工作?

我看到了什么,无论您的终端具有相同的配置。 该dfference只是路径,但所有其他的attrs是相同的。

这意味着,所有的邮件独立path将被发送到RequestChannel

我刚刚测试和eveything效果很好:

<int-http:inbound-gateway path="/*path1" request-channel="path"/>

<int-http:inbound-gateway path="/foo/*path1" request-channel="fooPath"/>


文章来源: http inbound gateway path url mapping