public bool Subscribe(IAmazonSQS amazonSQSClient, SqsQueueBase queue) { var subscriptionArn = Client.SubscribeQueue(Arn, amazonSQSClient, queue.Url); if (!string.IsNullOrEmpty(subscriptionArn)) { return true; } Log.Info(string.Format("Failed to subscribe Queue to Topic: {0}, Topic: {1}", queue.Arn, Arn)); return false; }
public bool Subscribe(SqsQueueBase queue) { var response = Client.Subscribe(new SubscribeRequest(Arn, "sqs", queue.Arn)); if (!string.IsNullOrEmpty(response.SubscriptionArn)) { queue.AddPermission(this); Log.Info(string.Format("Subscribed Queue to Topic - Queue: {0}, Topic: {1}", queue.Arn, Arn)); return(true); } Log.Info(string.Format("Failed to subscribe Queue to Topic: {0}, Topic: {1}", queue.Arn, Arn)); return(false); }
public bool IsSubscribed(SqsQueueBase queue) { var result = Client.ListSubscriptionsByTopic(new ListSubscriptionsByTopicRequest(Arn)); return(result.Subscriptions.Any(x => !string.IsNullOrEmpty(x.SubscriptionArn) && x.Endpoint == queue.Arn)); }
public bool IsSubscribed(SqsQueueBase queue) { var result = Client.ListSubscriptionsByTopic(new ListSubscriptionsByTopicRequest(Arn)); return result.Subscriptions.Any(x => !string.IsNullOrEmpty(x.SubscriptionArn) && x.Endpoint == queue.Arn); }