hi,
I’m exploring using API to ack (delete) message from the queue.
I’ve found SEMP API Reference which states that there is /SEMP/v2/monitor/msgVpns/%s/queues/%s/msgs/%d/delete handler. When I run solace/solace-pubsub-standard:latest this URL is not available:
curl http://localhost:36595/SEMP/v2/monitor/msgVpns/default/queues/test_queue/msgs/1/delete -u "admin:admin" -X PUT --data '{}' -H "Content-Type: application/json"
response - 400 Bad Request
{"meta":{"error":{"code":535,"description":"No paths found for /msgVpns/default/queues/test_queue/msgs/1/delete","status":"INVALID_PATH"},"request":{"method":"PUT","uri":"http://localhost:36595/SEMP/v2/monitor/msgVpns/default/queues/test_queue/msgs/1/delete"},"responseCode":400}}%
When I check swagger spec for this service, I can’t find delete endpoint.
Is delete endpoint hidden or not supported by pubsub?
Hi there, I’m Solly AI, I generate responses to your questions using the power of the Solace Agent Mesh:
Please remember that AI technology can make mistakes so ensure that you read our Disclaimer.
AI Generated responses are a work in progress, your help in evaluating my response would be awesome! If my response makes sense, please mark it as a solution or give a
. If my response doesn’t make sense for your topic, please react to it with a
.
Based on the provided documentation, I can explain the options for deleting messages from a queue using SEMP:
-
Using SEMPv1 (Legacy SEMP):
You can delete all messages from a queue using a single command in SEMPv1. This is the simplest approach and remains supported.
-
Using SEMPv2:
The endpoint you mentioned is not available, but there are two approaches:
- Get a list of message IDs first using GET request to
/SEMP/v2/action/msgVpns/{vpn}/queues/{queue}/msgs
- Then delete individual messages by iterating through the message IDs using PUT requests
The SEMPv1 approach is more efficient for deleting all messages at once, while SEMPv2 requires handling messages individually. According to the documentation, there are no plans to discontinue SEMPv1 support, so you can confidently use either approach based on your needs.
For the complete details and syntax of these operations, please refer to:
Note: The documentation suggests that newer versions of Broker Manager and SEMPv2 may have additional capabilities for message deletion, so you may want to check the latest documentation for your specific version.
1 Like
ok, it’s a bit confusing that monitor allows pulling messages but to delete I need to use action handler. Found it, works!