Creating Custom Message Header Fields

To create a custom message header field, you can create a map with custom user properties fields. The user properties are carried in the message separate from the payload.

JCSMP

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 ), and then specify the user properties for that map. Data for these fields can be added JCSMP map methods. For a comprehensive list of the available container methods and functions, refer to the following in the Products documentation.

C and .NET APIs

When using the C and .NET APIs, you can create a user property map for a message through a single function or method call. Each field in a user properties map is a SDT field. Once the map is created, data for fields in the map can be added with the C and .NET API container functions and methods. For a comprehensive list of the available container methods and functions, refer to the following in the PubSub+ Messaging APIs documentation for the appropriate messaging API.

JavaScript and Node.js APIs

To create custom message header fields, first create an SDT map with custom user properties fields, then pass it to the setUserPropertyMap function.

Creating a User Properties Map

PubSub+ Messaging API Use

JCSMP

XMLMessageProducer.createMap() or JCSMPFactory.createMap(), then call setProperties() for that map.

C

solClient_msg_createUserPropertyMap(...) and pass in an existing SDT.

.NET

IMessage.CreateUserPropertyMap()

JavaScript and Node.js

solace.Message.setUserPropertyMap(...) and pass in an existing SDT.

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.