Azure: How to move messages from poison queue to back to main queue?

匿名 (未验证) 提交于 2019-12-03 08:48:34

问题:

I'm wondering if there is a tool or lib that can move messages between queues? Currently, i'm doing something like below

public static void ProcessQueueMessage([QueueTrigger("myqueue-poison")] string message, TextWriter log) {         CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connString);         CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();         CloudQueue queue = queueClient.GetQueueReference("myqueue");         queue.CreateIfNotExists();          var messageData = JsonConvert.SerializeObject(data, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() });         queue.AddMessage(new CloudQueueMessage(messageData)); }

Thanks

回答1:

Essentially Azure Storage doesn't support moving messages from one queue to another. You would need to do this on your own.

One way to implement moving the messages from one queue to another is by dequeuing the messages from the source queue (by calling GetMessages), read the contents of the message and then creating a new message in the target queue. This you can do via using Storage Client Library.

One tool that comes to my mind for moving messages is Cerebrata Azure Management Studio. It has this functionality. For some reason, I think it is also available in Azure Storage Explorer tool as well but I may be wrong.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!