From eb1253f864e107ed7a02e2ac2ee03bbfb2951550 Mon Sep 17 00:00:00 2001 From: Or Ben Chitrit <10655932+Orbsynated@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:00:42 +0200 Subject: [PATCH] do not create sqs queue if option is true --- sqs/subscriber.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sqs/subscriber.go b/sqs/subscriber.go index 70e0996..3315745 100644 --- a/sqs/subscriber.go +++ b/sqs/subscriber.go @@ -297,6 +297,10 @@ func (s *Subscriber) SubscribeInitializeWithContext(ctx context.Context, topic s return nil } + if s.config.DoNotCreateQueueIfNotExists { + return fmt.Errorf("queue for topic '%s' doesn't exists", topic) + } + input, err := s.config.GenerateCreateQueueInput(ctx, resolvedQueue.QueueName, s.config.QueueConfigAttributes) if err != nil { return fmt.Errorf("cannot generate input for queue %s: %w", topic, err)