From ebd34b8666a7107c6f2c70d792f050c7472dec95 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Fri, 23 Dec 2022 09:43:09 +0200 Subject: [PATCH] Add setting subscription attributes to Sns and SnsQs --- SnsQsContext.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SnsQsContext.php b/SnsQsContext.php index 14dbc5a..4a71216 100644 --- a/SnsQsContext.php +++ b/SnsQsContext.php @@ -173,6 +173,17 @@ public function close(): void $this->getSqsContext()->close(); } + public function setSubscriptionAttributes(SnsQsTopic $topic, SnsQsQueue $queue, array $attributes): void + { + $this->getSnsContext()->setSubscriptionAttributes(new SnsSubscribe( + $topic, + $this->getSqsContext()->getQueueArn($queue), + SnsSubscribe::PROTOCOL_SQS, + false, + $attributes, + )); + } + private function getSnsContext(): SnsContext { if (null === $this->snsContext) {