Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This operation completes the processing of a locked message and deletes it from the queue or subscription. This operation should only be called after successfully processing a previously locked message, in order to maintain At-Least-Once delivery assurances.
Request
| Method | Request URI | HTTP Version |
|---|---|---|
| DELETE | https://{serviceNamespace}.servicebus.windows.net/{queuePath}/messages/{messageId|sequenceNumber}/{lockToken}or https://{serviceNamespace}.servicebus.windows.net/{topicPath}/subscriptions/{subscriptionName}/messages/{messageId|sequenceNumber}/{lockToken} |
HTTP/1.1 |
URI Parameters
Use the URI returned in the Location header by Peek-Lock Message, unchanged, with the DELETE method. The following table describes its message-reference and lock-token segments.
| Parameter | Description |
|---|---|
messageId or sequenceNumber |
The message-reference segment of the returned Location URI. Use the returned URI rather than constructing it from MessageId. |
lockToken |
The lock token in the returned Location URI and the LockToken property in BrokerProperties. |
Request Headers
The following table describes required and optional request headers. In addition to the listed properties, the header can contain custom properties. See the example.
| Request Header | Description |
|---|---|
| Authorization | Specify one of the following token values:
|
Request Body
None.
Response
The response includes an HTTP status code, a set of response headers, and the response body.
Response Codes
| Code | Description |
|---|---|
| 200 | Message successfully deleted. |
| 401 | Authorization failure. |
| 404 | No message was found for the specified lock token. |
| 410 | Specified queue or subscription doesn't exist. |
| 500 | Internal error. |
For information about status codes, see Status and Error Codes.
Response Headers
| Response Header | Description |
|---|---|
Content-Type |
application/xml; charset=utf-8 for a successful delete. The response body is empty. |
Response Body
None.
Example
The following HTTP request deletes a message from a queue:
DELETE https://your-namespace.servicebus.windows.net/httpclientsamplequeue/messages/2/7da9cfd5-40d5-4bb1-8d64-ec5a52e1c547 HTTP/1.1
Authorization: SharedAccessSignature sr=rukochbay&sig=rg9iGsK0ZyYlvhIqyH5IS5tqmeb08h8FstjHLPj3%2f8g%3d&se=1404265946&skn=RootManageSharedAccessKey
Host: your-namespace.servicebus.windows.net
Content-Length: 0
Service Bus returns the following response:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: application/xml; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Tue, 01 Jul 2014 23:00:35 GMT
0