Can the WSO2 ESB JMS transport add custom JMS head

2019-06-01 10:04发布

问题:

I am trying to add some custom JMS headers, required by another 3rd party system to the outgoing message.

I have tried adding the following property mediator:

<property xmlns="http://ws.apache.org/ns/synapse" name="HEADER" value="VALUE" scope="transport" type="STRING"/>

The JMS broker (ActiveMQ) is receiving the HEADER:VALUE but treating it as a property, rather than a header

I know there are reserved JMS header keywords, such as JMS_TIME_TO_LIVE, however these aren't well documented.

I suspect I may have to add something to the TRANSPORT_HEADERS map, however the documentation states it is filled from the client request, and again, these show as properties in ActiveMQ rather than headers

回答1:

The original was working correctly, and adding the values to the User defined properties collection of the JMS message. This is the correct place to add application headers.

<property xmlns="http://ws.apache.org/ns/synapse" name="HEADER" value="VALUE" scope="transport" type="STRING"/>

The issue was a configuration error in the 3rd party tool.