Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.SubscribeQueue C# (CSharp) Метод

SubscribeQueue() публичный Метод

Subscribes an existing Amazon SQS queue to an existing Amazon SNS topic.

The policy applied to the SQS queue is similar to this: { "Version" : "2008-10-17", "Statement" : [{ "Sid" : "topic-subscription-arn:aws:sns:us-west-2:599109622955:myTopic", "Effect" : "Allow", "Principal" : "*", "Action" : ["sqs:SendMessage"], "Resource":["arn:aws:sqs:us-west-2:599109622955:myQueue"], "Condition" : { "ArnLike":{ "aws:SourceArn":["arn:aws:sns:us-west-2:599109622955:myTopic"] } } }] }

There might be a small time period immediately after subscribing the SQS queue to the SNS topic and updating the SQS queue's policy, where messages are not able to be delivered to the queue. After a moment, the new queue policy will propagate and the queue will be able to receive messages. This delay only occurs immediately after initially subscribing the queue.

public SubscribeQueue ( string topicArn, ICoreAmazonSQS sqsClient, string sqsQueueUrl ) : string
topicArn string The topic to subscribe to
sqsClient ICoreAmazonSQS The SQS client used to get attributes and set the policy on the SQS queue.
sqsQueueUrl string The queue to add a subscription to.
Результат string
        public string SubscribeQueue(string topicArn, ICoreAmazonSQS sqsClient, string sqsQueueUrl)
        {
            return SubscribeQueueToTopics(new List<string>() { topicArn }, sqsClient, sqsQueueUrl).Values.First();
        }
AmazonSimpleNotificationServiceClient