Skip to content

Commit

Permalink
Merge pull request #1160 from gdsmith/surface-sqs-consumer-methods
Browse files Browse the repository at this point in the history
Add SqsConsumer methods to SnsQsConsumer
  • Loading branch information
makasim authored Apr 22, 2021
2 parents 856839e + 2da878c commit 9b1f0c3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pkg/snsqs/SnsQsConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,34 @@ public function __construct(SnsQsContext $context, SqsConsumer $consumer, SnsQsQ
$this->queue = $queue;
}

public function getVisibilityTimeout(): ?int
{
return $this->consumer->getVisibilityTimeout();
}

/**
* The duration (in seconds) that the received messages are hidden from subsequent retrieve
* requests after being retrieved by a ReceiveMessage request.
*/
public function setVisibilityTimeout(int $visibilityTimeout = null): void
{
$this->consumer->setVisibilityTimeout($visibilityTimeout);
}

public function getMaxNumberOfMessages(): int
{
return $this->consumer->getMaxNumberOfMessages();
}

/**
* The maximum number of messages to return. Amazon SQS never returns more messages than this value
* (however, fewer messages might be returned). Valid values are 1 to 10. Default is 1.
*/
public function setMaxNumberOfMessages(int $maxNumberOfMessages): void
{
$this->consumer->setMaxNumberOfMessages($maxNumberOfMessages);
}

public function getQueue(): Queue
{
return $this->queue;
Expand Down

0 comments on commit 9b1f0c3

Please sign in to comment.