简体   繁体   English

从天蓝色功能发送天蓝色服务总线中的完整代理消息

[英]send a full brokered message in azure service bus from an azure function

I'm facing issue to send a complete brokered message to an azure service bus output in azure function in javascript. 我正面临着在javascript中向azure函数中的天蓝色服务总线输出发送完整的代理消息的问题。 The documentation only show a simple body message https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus without any customerProperties. 该文档仅显示一个简单的正文消息https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus,没有任何customerProperties。

My attempts to create a full brokered message failed so far, everything goes into the body. 到目前为止,我尝试创建完整的代理消息失败了,一切都进入了正文。

在此输入图像描述 在此输入图像描述

var message = {'body' : 'test', 'customProperties' : {'fromsystem':'sap'}};
context.bindings.outputSbMsg = message;
context.done(null, res);

Unfortunately this is one of the limitations of node, as we lose some type information that we have in C#. 不幸的是,这是节点的限制之一,因为我们丢失了C#中的一些类型信息。

You could be trying to send a message with a body of test with custom properties, but you could also be trying to send the entire object as the body, with a body sub-property. 您可能尝试使用自定义属性发送带有test body的消息,但您也可能尝试使用body子属性将整个对象作为正文发送。 Azure Functions make the assumption that everything that you return should go into the body. Azure Functions假设您返回的所有内容都应该进入正文。

As a workaround, you could: 作为一种解决方法,您可以:

  • ditch the output binding and use the ServiceBus sdk for node directly 抛弃输出绑定并直接使用ServiceBus sdk作为节点
  • instead of node, use C# or F# with the actual BrokeredMessage type 而不是节点,使用C#或F#与实际的BrokeredMessage类型
  • have your node function put the result into a queue, which then triggers a C# function to create the exact BrokeredMessage you want 让您的节点函数将结果放入队列,然后触发C#函数以创建您想要的确切BrokeredMessage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用代理消息在门户中测试Azure功能服务总线触发器 - Testing an Azure Function Service Bus Trigger in the Portal with a Brokered Message Azure Service Bus代理消息安全性 - Azure Service Bus Brokered Message Security 如何将二进制消息从 Azure 函数发送到 Azure 服务总线 - How to send a binary message from Azure Function to Azure Service Bus 带有服务总线的 Azure 函数:无法“完成”和访问中转消息的属性 - Azure functions with service bus: Unable to “complete” and access properties of a brokered message 如何处理不带锁定令牌的Azure服务总线代理消息? - How to process azure service bus brokered message without lock token? 没有从azure服务总线订阅获得所有代理消息 - Not getting all the brokered messages from azure service bus subscription 从服务总线主题触发Azure功能,而不使用Brokered Connections - Trigger Azure Function from Service Bus topic without consuming Brokered Connections Azure 服务总线 - 代理连接数的估计 - Azure Service Bus - estimation of the number of brokered connection 如何从azure功能向azure服务总线添加消息? - How to add message to azure service bus from azure function? 使用Azure Bus服务队列在iOS设备和后端之间传输邮件 - Brokered message transfer between iOS device and backend using Azure Bus service queue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM