【发布时间】:2016-03-15 17:13:38
【问题描述】:
我想为通过 http 入站端点传入的消息添加动态标头。 目标是在一个映射中返回 XML 有效负载以及 dnamically 生成的标头,如下所示 增强消息类。然后,EnhancedMessage 消息应该被转发到下面的 processChannel; 我尝试使用如图所示的 Header 丰富器,但我从 http 入站而不是从 消息修改了 myBean 返回的一个。这可以做到吗?我希望链中的所有端点都接收到标头。 新的 Serializable 消息应该看起来像:
class EnhancedMessage implements Serializable{
String getXMLRaw(){}
Map<String,String> getHeaders(){}
}
<int-http:inbound-channel-adapter id="dataInbound"
supported-methods="POST" status-code-``expression="T(org.springframework.http.HttpStatus).ACCEPTED"
path="/ops/process" channel="processChannel">
</int-http:inbound-channel-adapter>
<int:chain input-channel="processChannel">
<int:header-enricher>
<ref bean="myBean"/>
</int:header-enricher>
<int:recipient-list-router>
<int:recipient channel="out1" />
<int:recipient channel="out2" />
</int:recipient-list-router>
</int:chain>
Everything works except the message enhancement. I would appreciate any directions on how to proceed.
【问题讨论】:
标签: spring-integration messaging