Ok, now I see. So few things here.
Content Enricher (what you currently using) is designed to enrich the "properties" of the payload and in the case of payload being a Map its key/value structure does not really follow the 'properties' conventions with set/get*.
Having said that I do believe there is a room for improvement in our implementation where you should (for the cases like you have) be able to do something like this:
Code:
<int:enricher input-channel="input" output-channel="output">
<int:expression value="payload.put('foo', headers.foo)"/>
<int:expression value="payload.put('bar', headers.bar)"/>
</int:enricher>
Basically the above allows you to execute an expression to enrich payload directly even if the payload type does not follow JavaBeans convention.
So I suggest raising the JIRA issue (as an Improvement) and we'll take care of it.
For the time being I's use regular Java transformer
Code:
public class MyTransformer {
public Object enrich(Message<Map<Object, Object>> message) {
Map<Object, Object> payload = message.getPayload();
Map<String, Object> headers = message.getHeaders();
payload.put('foo', headers.get("foo"));
payload.put('bar', headers.get("bar"));
return payload;
}
}
And in XML
<int:transformer input-channel="input" output-channel="output">
<bean class="foo.bar.MyTransformer"/>
</int:transformer>
Hoep that helps