I implemented the Message interface to include some headers for use with a HeaderValueRouter on server side.
Within one VM this works (tested using a filter between two endpoints).
But if I send the message through HttpOutboundGatway my fields get stripped (not included in the HttpRequest). And therefor the routing information is lost on server side.
Am I not supposed to manipulate headers?
public class TaskMessage implements Message<String> {
private MessageHeaders headers;
private String payload;
public TaskMessage(String taskId, String boxId, String payload) {
super();
this.taskId = taskId;
this.boxId = boxId;
this.payload = payload;
StringMessage sm = new StringMessage(payload);
Set<String> keySet = sm.getHeaders().keySet();
HashMap<String, Object> map = new HashMap<String, Object>();
for (String key : keySet) {
map.put(key, sm.getHeaders().get(key));
}
map.put("taskId", taskId);
map.put("boxId", boxId);
headers = new MessageHeaders(map);
}
@Override
public MessageHeaders getHeaders() {
return headers;
}
@Override
public String getPayload() {
return payload;
}
}
EDIT:
The version is 1.0.3
The part of my configuration is:
<si:inbound-channel-adapter ref="jdbcInputAdapter" method="fetchData" channel="msgChannel">
<si:poller max-messages-per-poll="1">
<si:interval-trigger interval="5000" />
</si:poller>
</si:inbound-channel-adapter>
<http:outbound-gateway id="httpChannelAdapter" auto-startup="true" request-timeout="1000" request-channel="msgChannel" reply-channel="replyChannel" default-url="http://localhost:8080/taskserver/gateway"/>