10.25.0

IMessageCreateUserPropertyMap Method

Creates a user property map (of type IMapContainer) in the meta header of a message. Any existing user property map is overwritten. After adding user properties to this map, it must be closed; if not, it is automatically closed after the associated message is disposed IDisposable.

Whether it is explicitly closed by the client application, or implicitly by the API, any attempt to use this map results in an OperationErrorException with ParamNullReference

Definition

Namespace: SolaceSystems.Solclient.Messaging
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.25.0
C#
IMapContainer CreateUserPropertyMap()

Return Value

IMapContainer
The created user property map.

Remarks

Do not set UserPropertyMap to the result of this method. Doing so will cause the underlying structure to be disposed. Correctly accessing the property map:
C#
IMessage msg = ContextFactory.Instance.CreateMessage();
msg.CreateUserPropertyMap();
msg.UserPropertyMap.AddString("message", "5");

Exceptions

OperationErrorException Thrown when the method invocation fails. ReturnCode and ErrorInfo will be accessible from OperationErrorException
FatalErrorException Thrown when an unrecoverable error occurs.

See Also