Solace Community is getting a facelift!
On March 3rd we will be starting the process of migrating Solace Community to a new platform. As a result, Solace Community will go in to a temporary read-only state. You will still be able to come onto Solace Community and search through posts to find answers, but you won't be able to ask questions, post comments, or react in any way.
We hope to have the migration complete by Wednesday March 5th (or sooner), so please keep an eye out!
SEMP API to delete the messages from the queue?
Hi Team,
Is there any way or SEMP API available to delete the messages from a queue?
Thanks
Tejas
Best Answer
-
@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/getMsgVpnQueueMsgsand iterate over them to call delete
https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/action/index.html#/queue/doMsgVpnQueueMsgDeleteAlso pl see this thread:
https://solace.community/discussion/657/delete-all-the-messages-on-a-queue-using-legacy-semp2
Answers
-
@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/getMsgVpnQueueMsgsand iterate over them to call delete
https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/action/index.html#/queue/doMsgVpnQueueMsgDeleteAlso pl see this thread:
https://solace.community/discussion/657/delete-all-the-messages-on-a-queue-using-legacy-semp2 -
Thanks @nram,this helps
0 -
@tejaschowsalkar Can you accept the answer from @nram for the benefits of other people in the community? Thanks!
0 -
-
Thanks, @tejaschowsalkar. I've accepted it as the best answer on your behalf.
0 -