我目前正在处理一个 POC,我正在从 azure 队列中排出消息 - 该队列在数据库 CRUD 操作期间通过动态 CRM 插件填充。使用 java 客户机的队列排出操作失败,并显示以下消息:
<Error>
<Code>500</Code>
<Detail>
The service was unable to process the request; please retry the operation. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101. TrackingId:add85f1a-a249-4e69-b284-ad879cd29968_G27, SystemTracker:scsqueue1-ns:Queue:scsqueue1, Timestamp:7/6/2016 7:21:49 PM
</Detail>
</Error>
java客户端可以在这里找到:https://github.com/sharpcodes/scs-bus-demo
但是,使用 C# 客户端可以工作
我在 GitHub 上的代码中看不到明显的问题。但是,根据我的经验,我建议你可以尝试使用该工具Fiddler
来调试代码中的 rest 请求,因为适用于 Java 的 Azure 服务总线 SDK 包装了 REST API,例如用于清空消息的 Receive and Delete Message (Destructive Read)
。
同时,Java 中有三种方法可以通过 Azure 上的操作Receive and Delete Message
来排出消息。
- 使用适用于 Java 的 Azure 服务总线 SDK,请参阅教程"如何使用服务总线队列"的第
Receive messages from a queue
部分,了解如何使用默认模式ReceiveAndDelete
。 - 将适用于 Java 的 Azure 服务总线 REST API 与 http 客户端配合使用,请参阅教程"服务总线代理消息传送 REST 教程"的第
Receive and delete a message from the queue
部分。
在 Java 中使用 JMS API 和 AMQP 1.0, - 请参考教程"如何将 Java 消息服务 (JMS) API 与服务总线和 AMQP 1.0 配合使用"的第
Coding Java applications
部分,查看函数SimpleSenderReceiver()
。
感谢彼得对此的指导。
看起来动态 crm-azure 总线插件存在问题,该插件阻止 java/node-js 客户端使用 SDK 或 RestFul 调用耗尽队列。
使用 JMS 客户端似乎可以解决问题。另一种方法是拥有一个可以由Java/Node包装的C#中间件。
以下是对问题的引用: https://github.com/Azure/azure-sdk-for-php/issues/823
该问题现已关闭,因为Azure Java SDK团队必须进行修复才能正确转义字符。