简体   繁体   English

如何使用REST Client在Azure Service Bus主题上窥视锁定消息而不接收和删除

[英]How to Peek-Lock Message and not Receive and Delete on Azure Service Bus Topic using REST Client

At Microsfot Docs I don't saw the diference from Receive and Delete Message from Peek-Lock Message. 在Microsfot Docs上,我没有看到与Peek-Lock Message中的Receive and Delete Message有区别。 The Request is the same. 该请求是相同的。

I tried the request using Postman. 我尝试使用邮递员的请求。 How to use Peek and how to use Delete? 如何使用Peek以及如何使用Delete? See the documentation link: 请参阅文档链接:

https://docs.microsoft.com/en-us/rest/api/servicebus/peek-lock-message-non-destructive-read https://docs.microsoft.com/zh-cn/rest/api/servicebus/peek-lock-message-non-destructive-read

https://docs.microsoft.com/en-us/rest/api/servicebus/receive-and-delete-message-destructive-read https://docs.microsoft.com/zh-cn/rest/api/servicebus/receive-and-delete-message-destructive-read

I need to use Peek, i want keep the message for other readers. 我需要使用Peek,我希望将消息保留给其他读者。

If you closely look at the HTTP Request methods, for Peek Lock the request method is Post while for Receive and Delete it is Delete . 如果您仔细查看HTTP Request方法,则对于Peek Lock ,请求方法为Post而对于Receive and Delete ,请求方法为Delete

If you want to Peek Lock a message, you will need to use HTTP POST method. 如果要Peek Lock消息,则需要使用HTTP POST方法。

However, please keep in mind that Peek Lock method dequeues a message from the queue and it will remain invisible to other callers for certain duration. 但是,请记住, Peek Lock方法使消息从队列中出队,并且在某些持续时间内,其他调用者将看不见该消息。 Furthermore after a message has been dequeued a certain number of times, it will be dead lettered. 此外,在将消息出队一定次数后,该消息将被删除。

Unfortunately simple peeking at a message (ie fetching a message without dequeuing it) is not possible with REST API (HTTP Protocol). 不幸的是,使用REST API(HTTP协议)无法简单地窥视消息(即在不使消息出队的情况下获取消息)。 You will need to use AMQP protocol to do so. 您将需要使用AMQP协议。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM