/** * @inheritdoc * * @throws SqsException */ public function purgeQueue($queueName, $priority = null) { if (null === $priority) { $priorities = $this->priorityHandler->getAll(); foreach ($priorities as $priority) { $this->purgeQueue($queueName, $priority); } return $this; } if (empty($queueName)) { throw new InvalidArgumentException('Parameter queueName empty or not defined.'); } $queueUrl = $this->sqsClient->getQueueUrl(['QueueName' => $this->getQueueNameWithPrioritySuffix($queueName, $priority)])->get('QueueUrl'); $this->sqsClient->purgeQueue(['QueueUrl' => $queueUrl]); return $this; }
/** * @inheritdoc * * @throws \InvalidArgumentException * @throws QueueAccessException */ public function purgeQueue($queueName, Priority $priority = null) { if (null === $priority) { $priorities = $this->priorityHandler->getAll(); foreach ($priorities as $priority) { $this->purgeQueue($queueName, $priority); } return $this; } if (empty($queueName)) { throw new \InvalidArgumentException('Queue name empty or not defined.'); } try { $queueUrl = $this->sqsClient->getQueueUrl(['QueueName' => $this->getQueueNameWithPrioritySuffix($queueName, $priority)])->get('QueueUrl'); $this->sqsClient->purgeQueue(['QueueUrl' => $queueUrl]); } catch (SqsException $e) { throw new QueueAccessException('Cannot purge queue', 0, $e); } return $this; }
/** * @inheritdoc */ public function purge($queue) { $this->sqs->purgeQueue(['QueueUrl' => $queue]); }
public function purge() { $this->client->purgeQueue(["QueueUrl" => $this->getQueueUrl()]); }