Skip to content

Commit

Permalink
Merge pull request #10 from devsrv/main
Browse files Browse the repository at this point in the history
added vhost option & configs to target env
  • Loading branch information
mhfereydouni authored Apr 11, 2023
2 parents 38f53c8 + bb6a591 commit a046053
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ This is the contents of the published config file:
<?php

return [
'host' => 'rabbitmq',
'port' => '5672',
'user' => 'guest',
'password' => 'guest',
'host' => env('RABBITMQ_HOST', '127.0.0.1'),
'port' => env('RABBITMQ_PORT', 5672),
'user' => env('RABBITMQ_USER', 'guest'),
'password' => env('RABBITMQ_PASSWORD', 'guest'),
'vhost' => env('RABBITMQ_VHOST', '/'),

'consumers' => [
// [
Expand Down
11 changes: 6 additions & 5 deletions config/rabbitmq.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

return [
'host' => 'rabbitmq',
'port' => '5672',
'user' => 'guest',
'password' => 'guest',

'host' => env('RABBITMQ_HOST', '127.0.0.1'),
'port' => env('RABBITMQ_PORT', 5672),
'user' => env('RABBITMQ_USER', 'guest'),
'password' => env('RABBITMQ_PASSWORD', 'guest'),
'vhost' => env('RABBITMQ_VHOST', '/'),

'consumers' => [
// [
// 'event' => '\App\Events\MyEvent',
Expand Down
3 changes: 2 additions & 1 deletion src/RabbitMQ.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public function __construct()
config('rabbitmq.host'),
config('rabbitmq.port'),
config('rabbitmq.user'),
config('rabbitmq.password')
config('rabbitmq.password'),
config('rabbitmq.vhost')
);

$this->channel = $this->connection->channel();
Expand Down

0 comments on commit a046053

Please sign in to comment.