Skip to content

Commit 02462af

Browse files
author
palPalani
committed
Improved getting count and queue name
1 parent c962db4 commit 02462af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Sqs/Queue.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ public function pop($queue = null)
6969
$queueId = explode('/', $queue);
7070
$queueId = array_pop($queueId);
7171

72-
$count = (array_key_exists($queue, Config::get('sqs-queue-reader.handlers')))
73-
? Config::get('sqs-queue-reader.handlers')[$queue]['count']
72+
$count = (array_key_exists($queueId, Config::get('sqs-queue-reader.handlers')))
73+
? Config::get('sqs-queue-reader.handlers')[$queueId]['count']
7474
: Config::get('sqs-queue-reader.default-handler')['count'];
7575

7676
try {
7777
$response = $this->sqs->receiveMessage([
78-
'QueueUrl' => $queue,
78+
'QueueUrl' => $queueId,
7979
'AttributeNames' => ['ApproximateReceiveCount'],
8080
'MaxNumberOfMessages' => $count,
8181
'MessageAttributeNames' => ['All'],
@@ -95,7 +95,7 @@ public function pop($queue = null)
9595
}
9696
Log::debug('New $responseV2==', [$response]);
9797

98-
return new SqsJob($this->container, $this->sqs, $response, $this->connectionName, $queue);
98+
return new SqsJob($this->container, $this->sqs, $response, $this->connectionName, $queueId);
9999
}
100100
} catch (AwsException $e) {
101101
$msg = 'Line: '. $e->getLine() .', '. $e->getFile() . ', '. $e->getMessage();

0 commit comments

Comments
 (0)