LibraryLink ToToggle FramesPrintFeedback

Setting Custom JMS Properties

The JMS specification allows for the placing of custom properties into a message's header. These custom properties are specified as a set of name/value pairs that can store both simple types and Java objects. The properties can be used for a number of tasks including message selection.

When using the FUSE ESB JMS binding component, you define the custom properties added to the reply messages as property map. This is done using the Spring map element. You can configure one static map that will be applied to every reply message generated by the consumer.

You can configure a consumer to add custom properties to reply messages in one of two ways:

The property map containing the custom properties you want added to the reply messages is stored in a java.util.Map object. You define that map object using the Spring util:map element.

The util:map element is defined in the http://www.springframework.org/schema/util namespace. In order to use the element you will need to add the following namespace alias to your beans element:

xmlns:util="http://www.springframework.org/schema/util"

The entries in the map are defined by adding entry child element's to the util:map element. Each entry element takes two attributes. The key entry is the map key and corresponds to the properties name. The value attribute is the value of the property.

[Tip]Tip

If you want the value of a property to be complex type that is stored in a Java object, you can use the entry element's ref attribute instead of the value attribute. The ref attribute points to another bean element that defines a Java object.

Example 3.13 shows an example of a SOAP consumer whose reply messages have a set of custom properties added to their header.