如何在Solace中将标头与有效载荷一起发送 [英] How to send the header along with payload in Solace

查看:233
本文介绍了如何在Solace中将标头与有效载荷一起发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们还要求将标头信息以及有效载荷也发送到Solace.我们怎样才能做到这一点?

We have requirement to send header information too along with payload to Solace. How can we achieve this?

推荐答案

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

Solace messages allow users to set custom user property (a.k.a header) fields along with the message payload. It is usually required to first insert the desired headers into a Structured Data Map (SDTMap) and then set the SDTMap as the user property section of the message.

Java

XMLMessage.setProperties()

C

solClient_msg_createUserPropertyMap()

.NET

IMessage.CreateUserPropertyMap()

对于上述3个API,您可能会在API指南中找到创建自定义消息标题字段"部分. https://sftp.solacesystems.com/Portal_Docs/#page/Solace_Merging/Using_Structured_Data.html#ww607779

For the above 3 APIs, you might find the "Creating Custom Message Header Fields" section in the API guide useful. https://sftp.solacesystems.com/Portal_Docs/#page/Solace_Messaging_APIs_Developer_Guide/Using_Structured_Data.html#ww607779

JavaScript

message.setUserPropertyMap(map);

Silverlight

message.UserPropertyMap = map;

ActionScript

message.UserPropertyMap = map;

对于基于Web的API,您可能会在Web Messaging API指南中找到创建用户属性映射"部分. https://sftp.solacesystems.com/Portal_Docs_API_essa_Web_Message_API_/Using_Structured_Data_Types.html#ww619248

For Web-based APIs, you might find the "Creating User Property Maps" section in the Web Messaging API guide useful. https://sftp.solacesystems.com/Portal_Docs/#page/Solace_Web_Messaging_APIs_Developer_Guide/Using_Structured_Data_Types.html#ww619248

REST

包括以下格式的HTTP标头:Solace-User-Property-<name>: <value>

Include a HTTP header of this format: Solace-User-Property-<name>: <value>

您会发现其余消息协议"指南的"Solace消息自定义属性"部分很有帮助. https://sftp.solacesystems.com/Portal_Docs/#page/Pro_col_Messaging/2_Solace_REST_Message_Encoding.html#wwpID0E0DN0HA

You will find "Solace Message Custom Properties" section of the Rest Messaging protocol guide helpful. 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)

Use standard JMS methods to set message headers. For example, Message.setStringProperty(String name, String value)

这篇关于如何在Solace中将标头与有效载荷一起发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆