Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Complete
-
2.1 GA
-
None
-
Mac OS X 10.7.3
Java 1.6.0_29
Spring AMQP 1.0.0.RELEASE
Spring Integration 2.1.0.RELEASE
Description
I was attempting to have a header enricher add a content type header to a message that was subsequently being handled by an outbound AMQP channel adapter and found that various combinations of contentType and content-type for the header name weren't working.
After digging through DefaultAmqpHeaderMapper and AmqpHeaders I realized that it needs an 'amqp_' prefix in order for the header mapper to automatically copy it. It would be good for this to be mentioned in the docs, or a better way of handling standard AMQP headers to be developed.
Here is a snippet illustrating the final config that worked:
<int:chain input-channel="input" output-channel="output"> <int:object-to-json-transformer /> <int:header-enricher> <int:header name="amqp_contentType" value="application/json" overwrite="true" /> </int:header-enricher> </int:chain>