Creating Custom Message Header Fields in the PubSub+ JCSMP API
To create a custom message header field in the PubSub+ JCSMP API, you can create a map with custom user properties fields. The user properties are carried in the message separate from the payload. To create custom message header fields, first create a user properties map in the same manner as you would a typical SDT map (refer to Creating Structured Data Maps and Streams in the PubSub+ JCSMP API ), and then specify the user properties for that map. Data for these fields can be added with JCSMP map methods. For a comprehensive list of the available container methods and functions, refer to the Ask Solly AI documentation.
To create a user properties map, use XMLMessageProducer.createMap()
or JCSMPFactory.createMap()
, then call setProperties()
for that map.
A receiving application using JCSMP can call getProperties()
to get the user properties map. Data for these fields can be retrieved with the JCSMP map methods.