[英]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: 作为一种解决方法,您可以:
BrokeredMessage
type BrokeredMessage
类型 BrokeredMessage
you want BrokeredMessage
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.