【问题标题】:How to send the header along with payload in Solace如何在 Solace 中发送标头和有效负载
【发布时间】:2016-04-06 06:42:24
【问题描述】:

我们还要求将标头信息连同有效负载一起发送到 Solace。我们怎样才能做到这一点?

【问题讨论】:

  • 您能否阐明您尝试使用的 API(例如 C、.NET、Java、MQTT、REST 等)。此外,您的标题示例会有所帮助。

标签: solace


【解决方案1】:

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


Java

XMLMessage.setProperties()

C

solClient_msg_createUserPropertyMap()

.NET

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-10
    • 2013-12-07
    • 2021-09-14
    • 2019-04-03
    • 1970-01-01
    • 1970-01-01
    • 2014-02-05
    • 2015-06-29
    相关资源
    最近更新 更多