Is there any way or SEMP API available to delete the messages from a queue?
@tejaschowsalkar , Looking at the SEMPv2 Action API reference, there is no single API call to delete ALL messages.
You will have get the list of messages with GET first https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/action/index.html#/queue/getMsgVpnQueueMsgs
and iterate over them to call deletehttps://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/action/index.html#/queue/doMsgVpnQueueMsgDelete
Also pl see this thread:https://solace.community/discussion/657/delete-all-the-messages-on-a-queue-using-legacy-semp
Thanks @nram,this helps
@tejaschowsalkar Can you accept the answer from @nram for the benefits of other people in the community? Thanks!
@hong -Yes,the answer from @nram is acceptable
Thanks, @tejaschowsalkar. I've accepted it as the best answer on your behalf.
Hi, this can be done simply with a SEMPv1 script. There is an example purge queue script here.
Check this post by @amackenzie ! https://solace.community/discussion/1382/delete-all-messages-on-a-queue-topic-endpoint-now-available-in-broker-manager-and-sempv2