Exemplo n.º 1
0
 /**
  * @inheritdoc
  *
  * @throws QueueAccessException
  */
 public function listQueues($prefix = '')
 {
     $listQueues = [];
     try {
         if (empty($prefix)) {
             $results = $this->sqsClient->listQueues();
         } else {
             $results = $this->sqsClient->listQueues(['QueueNamePrefix' => $prefix]);
         }
     } catch (SqsException $e) {
         throw new QueueAccessException('Cannot list queues', 0, $e);
     }
     $results = $results->get('QueueUrls');
     foreach ($results as $result) {
         $result = explode('/', $result);
         $result = array_pop($result);
         $priorities = $this->priorityHandler->getAll();
         foreach ($priorities as $priority) {
             if (!empty($priority)) {
                 $result = str_replace(static::PRIORITY_SEPARATOR . $priority->getName(), '', $result);
             }
         }
         $listQueues[] = $result;
     }
     $listQueues = array_unique($listQueues);
     return $listQueues;
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  *
  * @throws SqsException
  */
 public function listQueues($prefix = '')
 {
     $listQueues = [];
     if (empty($prefix)) {
         $results = $this->sqsClient->listQueues();
     } else {
         $results = $this->sqsClient->listQueues(['QueueNamePrefix' => $prefix]);
     }
     $results = $results->get('QueueUrls');
     foreach ($results as $result) {
         $result = explode('/', $result);
         $result = array_pop($result);
         $priorities = $this->priorityHandler->getAll();
         foreach ($priorities as $priority) {
             if (!empty($priority)) {
                 $result = str_replace(static::PRIORITY_SEPARATOR . $priority, '', $result);
             }
         }
         $listQueues[] = $result;
     }
     $listQueues = array_unique($listQueues);
     return $listQueues;
 }
 public function getQueues()
 {
     $response = $this->service->listQueues(array());
     return $response->get('QueueUrls');
 }
Exemplo n.º 4
0
 /**
  * @return array
  */
 protected function getUrls()
 {
     $elements = $this->client->listQueues(['QueueNamePrefix' => $this->config->getQueueNamePrefix()]);
     return $elements->getPath('QueueUrls') ?: [];
 }