且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取“amqp:内部错误"使用 AMQP、rhea 和 Node 从 Azure 服务总线队列查看消息时

更新时间:2023-11-25 12:53:46

在 Azure Service Bus 团队的帮助下,我找到了这个问题的解决方案(实际上,他们给了我这个解决方案).messageBody 的基本元素应该使用 AMQP 类型正确编码.

With help of Azure Service Bus team, I was able to find a solution to this problem (in fact, they gave me this solution). Essentially elements of messageBody should be properly encoded using AMQP types.

以下代码有效:

  var messageBody = {
    'from-sequence-number': client.types.wrap_long(1),
    'message-count': client.types.wrap_int(5)
  };

  const msg = {
    application_properties: {
      operation: 'com.microsoft:peek-message'
    },
    body: messageBody,
    reply_to: 'receiver-link'
  };