laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.48k stars 419 forks source link

Config doesn't get updated in QueueManager #714

Closed coderNeos closed 6 years ago

coderNeos commented 6 years ago

Description:

I've found that

Illuminate\Support\ServiceProvider::mergeConfigFrom()

called from service provider doesn't affect actual config values in QueueManager (and maybe other instances).

I have installed https://github.com/vyuldashev/laravel-queue-rabbitmq.

After calling

VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider::register() 

app['config'] gets updated with correct driver variables, but later when calling

Illuminate\Queue\QueueManager::getConfig()

variables are reverted to those which where set initially in config/queue.php.

As a result our queue is not working, because it doesn't have needed config variables.

Steps To Reproduce:

Append these lines of code:

var_dump($this->app['config']["queue.connections.rabbitmq"]);

to

VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider::register() 

Add these lines of code:

var_dump($this->app['config']["queue.connections.{$name}"]);

to

Illuminate\Queue\QueueManager::getConfig() 

before:

return $this->app['config']["queue.connections.{$name}"];

then execute

php artisan queue:work
driesvints commented 6 years ago

This seems like a problem with the library itself. Try posting an issue on their repo and if the problem really lies with Lumen feel free to reply back or open a new issue.

nifrasismail commented 5 years ago

I fix this issue by manually register service provider on bootatrap/app.php as follow

$app->register(VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider::class);

coderNeos commented 5 years ago

To fix this issue i've just copied LaravelQueueRabbitMQ config to project config folder and named it "queue.php"