Skip to content

Commit 78051c9

Browse files
committed
remove RABBITMQ_HOST,PORT etc env vars.
1 parent 129c9e0 commit 78051c9

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

examples/consume.php

+1-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@
1717

1818
use Enqueue\AmqpLib\AmqpConnectionFactory;
1919

20-
$config = [
21-
'host' => getenv('RABBITMQ_HOST'),
22-
'port' => getenv('RABBITMQ_AMQP__PORT'),
23-
'user' => getenv('RABBITMQ_USER'),
24-
'pass' => getenv('RABBITMQ_PASSWORD'),
25-
'vhost' => getenv('RABBITMQ_VHOST'),
26-
'receive_method' => 'basic_consume',
27-
];
28-
29-
$factory = new AmqpConnectionFactory($config);
20+
$factory = new AmqpConnectionFactory(getenv('RABBITMQ_AMQP_DSN'));
3021
$context = $factory->createContext();
3122

3223
$queue = $context->createQueue('foo');

examples/produce.php

+1-9
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@
2020
use Interop\Amqp\AmqpTopic;
2121
use Interop\Amqp\Impl\AmqpBind;
2222

23-
$config = [
24-
'host' => getenv('RABBITMQ_HOST'),
25-
'port' => getenv('RABBITMQ_AMQP__PORT'),
26-
'user' => getenv('RABBITMQ_USER'),
27-
'pass' => getenv('RABBITMQ_PASSWORD'),
28-
'vhost' => getenv('RABBITMQ_VHOST'),
29-
];
30-
31-
$factory = new AmqpConnectionFactory($config);
23+
$factory = new AmqpConnectionFactory(getenv('RABBITMQ_AMQP_DSN'));
3224
$context = $factory->createContext();
3325

3426
$topic = $context->createTopic('test.amqp.ext');

0 commit comments

Comments
 (0)