2014-10-24 1 views
0

나는이 두 INT-HTTP : 내가HTTP 수신 게이트웨이 경로의 URL 매핑

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 을에 요청을 줄 때 그 어떤 happing을 일관성없는 below.when 언급 한 바와 같이 경로 인바운드 게이트웨이 "default"를 호출하고 있습니다. gateway.i는 /*Serivce.But 경로 때문에 이해합니다. 우선 순위를 지정하거나 우선 순위를 지정하거나 "XYZ"를 먼저 확인한 다음 "default"를 확인하는 URL을 제공 할 수 있습니다.

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> 

답변

0

정말 제대로 작동하지 않는다고 확신 할 수 있습니까?

두 엔드 포인트의 구성이 동일한 것을 확인하십시오. 차이점은 경로에만 있지만 다른 모든 attrs는 동일합니다.

즉, path과 별개로 모든 메시지는 RequestChannel으로 전송됩니다.

난 그냥 테스트 한 및 eveything 잘 작동 :

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

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

감사를 위해 reply.Sorry 내 나는 내가 같은 회신 channel.I을 넣어에만 실수로 다른 응답 채널을 넣어 의도가 나쁜 내 원래의 메시지에서 올바른 하나를 편집했습니다. 내가 직면하고있는 문제는 다른 시간에 reply-channel = "ResponseChannel"에서 응답을 얻는 것입니다. http : // localhost : 8080/XYZ/ABCService/reply-channel = "XYZResponseChannel" – Annavi