1

我们也需要将标头信息与有效负载一起发送到 Solace。我们怎样才能做到这一点?

4

1 回答 1

2

Solace 消息允许用户设置自定义用户属性(也称为标头)字段以及消息负载。通常需要先将所需的标头插入结构化数据映射 (SDTMap),然后将 SDTMap 设置为消息的用户属性部分。


爪哇

XMLMessage.setProperties()

C

solClient_msg_createUserPropertyMap()

。网

IMessage.CreateUserPropertyMap()

对于上述 3 个 API,您可能会发现 API 指南中的“创建自定义消息头字段”部分很有用。 https://sftp.solacesystems.com/Portal_Docs/#page/Solace_Messaging_APIs_Developer_Guide/Using_Structured_Data.html#ww607779


JavaScript

message.setUserPropertyMap(map);

银光

message.UserPropertyMap = map;

动作脚本

message.UserPropertyMap = map;

对于基于 Web 的 API,您可能会发现 Web 消息 API 指南中的“创建用户属性映射”部分很有用。 https://sftp.solacesystems.com/Portal_Docs/#page/Solace_Web_Messaging_APIs_Developer_Guide/Using_Structured_Data_Types.html#ww619248


休息

包含此格式的 HTTP 标头:Solace-User-Property-<name>: <value>

您会发现 Rest Messaging 协议指南的“Solace Message Custom Properties”部分很有帮助。 https://sftp.solacesystems.com/Portal_Docs/#page/REST_Messaging_Protocol_Guide/2_Solace_REST_Message_Encoding.html#wwpID0E0DN0HA


管理系统

使用标准 JMS 方法来设置消息头。例如,Message.setStringProperty(String name, String value)

于 2016-04-12T04:48:07.263 回答