405通过REST API向Azure Service总线队列发送消息时出错

问题描述 投票:0回答:1

我正在尝试通过POSTMAN使用REST API将消息发送到Azure ServiceBus队列,但是当我触发消息时,出现以下错误:-

<Code>405</Code>

<Detail>The SessionId was not set on a message, and it cannot be sent to the entity. Entities that have session support enabled can only receive messages that have the SessionId set to a valid value. TrackingId:aew3fd4-9721d-455456-df56-453345, SystemTracker:SampleNamespace:Queue:queue_name, Timestamp:2019-09-30T10:27:09</Detail>

enter image description here有人可以告诉我如何在标题标签中添加sessionId以及如何设置吗?我尝试了几件事,但是没有用。

感谢,陀罗

azureservicebus azure-servicebus-queues
1个回答
0
投票

必须在broker_properties标头中定义sessionId

BrokerProperties:  { “SessionId”: “{Your session ID}”, “MessageId”: “{701332E1-B37B-4D29-AA0A-E367906C206E}”, “TimeToLive” : 90, “CorrelationId”: “{701332F3-B37B-4D29-AA0A-E367906C206E}”, “SequenceNumber“ : 12345, “DeliveryCount“ : 2, “To“ : "http://contoso.com“, “ReplyTo“ : "http://fabrikam.com“,  "EnqueuedTimeUtc“ : " Sun, 06 Nov 1994 08:49:37 GMT“, "ScheduledEnqueueTimeUtc“ : " Sun, 06 Nov 1994 08:49:37 GMT“}

you can find more details from here

© www.soinside.com 2019 - 2024. All rights reserved.