使用.NET检查AWS中是否存在SQS

编程入门 行业动态 更新时间:2024-10-27 02:27:02
本文介绍了使用.NET检查AWS中是否存在SQS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我能够使用AWSSDK.SQS包中的AmazonSQSClient客户端将消息成功发送到.NET中的队列.

I'm able to successfully send messages to a queue in .NET using the AmazonSQSClient clientin the AWSSDK.SQS package.

如何检查特定队列是否存在以及是否没有创建特定队列?

How can I check to see whether a specific queue exists, and if it doesn't create it?

推荐答案

您需要使用AmazonSQSClient.GetQueueUrl (string)方法运行检查,其中的字符串是队列名称.如果队列不存在,则抛出QueueDoesNotExistException.为了执行您想要的操作,您需要捕获异常,然后使用该名称创建队列.

You'd need to run a check using the AmazonSQSClient.GetQueueUrl (string) method, where the string is the queue name. If the queue doesn't exist, it throws QueueDoesNotExistException. For you to do what you want, you'd need to catch the exception, and then create the queue using that name.

所有这些都在SQS .Net文档中列出这里

This is all listed in the SQS .Net Documentation here

更多推荐

使用.NET检查AWS中是否存在SQS

本文发布于:2023-11-10 02:58:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574157.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:是否存在   NET   AWS   SQS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!