简体   繁体   中英

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. The Request is the same.

I tried the request using Postman. How to use Peek and how to use Delete? See the documentation link:

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

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

I need to use Peek, i want keep the message for other readers.

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 .

If you want to Peek Lock a message, you will need to use HTTP POST method.

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. 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). You will need to use AMQP protocol to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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