无法使用int-http:outbound-gateway在响应时映射自定义http标头

时间:2016-10-28 02:12:02

标签: spring-integration

我有一个带有自定义http标头的休息服务的int-http:outbound-gateway,但是此标头未映射到SI消息标头,尽管已在mapped-response-headers config上设置

这是我的配置:

<int-http:outbound-gateway 
    request-channel="inChannel" reply-channel="outChannel"
    url-expression="http://localhost:8080/rest" mapped-request-headers="HTTP_REQUEST_HEADERS"
    http-method-expression="GET" expected-response-type="java.lang.String"
    charset="UTF-8" 
    mapped-response-headers="HTTP_RESPONSE_HEADERS,mySpecificHeader"/>

以下是其他服务的原始回复:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Expires: Fri, 28 Oct 2016 02:05:34 GMT
mySpecificHeader: headerInfo
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 28 Oct 2016 02:05:34 GMT

{"surname":"Constantine","phone":"+33 555 666 777","name":"John","id":12345}

0 个答案:

没有答案