Skip to content

Commit f904e63

Browse files
committed
migrate from pecl extension to php amqp lib
1 parent 4c92e62 commit f904e63

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/FintechFab/LaravelQueueRabbitMQ/Queue/RabbitMQQueue.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class RabbitMQQueue extends Queue implements QueueInterface
1515
protected $connection;
1616
protected $channel;
1717

18+
protected $defaultQueue;
1819
protected $configQueue;
1920
protected $configExchange;
2021

@@ -25,8 +26,9 @@ class RabbitMQQueue extends Queue implements QueueInterface
2526
public function __construct(AMQPConnection $amqpConnection, $config)
2627
{
2728
$this->connection = $amqpConnection;
28-
$this->configQueue = $config['queue'];
29-
$this->configExchange = $config['exchange'];
29+
$this->defaultQueue = $config['queue'];
30+
$this->configQueue = $config['queue_params'];
31+
$this->configExchange = $config['exchange_params'];
3032

3133
$this->channel = $this->getChannel();
3234
}
@@ -141,7 +143,7 @@ public function pop($queue = null)
141143
*/
142144
public function getQueueName($queue)
143145
{
144-
return $queue ?: $this->configQueue['name'];
146+
return $queue ?: $this->defaultQueue;
145147
}
146148

147149
/**

src/examples/queue.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
'login' => '',
2222
'password' => '',
2323

24-
'queue' => [
25-
'name' => '', // name of the default queue,
24+
'queue' => '', // name of the default queue,
25+
26+
'queue_params' => [
2627
'passive' => false,
2728
'durable' => true,
2829
'exclusive' => false,
2930
'auto_delete' => false,
3031
],
3132

32-
'exchange' => [
33+
'exchange_params' => [
3334
'type' => 'direct', // more info at http://www.rabbitmq.com/tutorials/amqp-concepts.html
3435
'passive' => false,
3536
'durable' => true, // the exchange will survive server restarts

0 commit comments

Comments
 (0)