laravel-queue-rabbitmq
laravel-queue-rabbitmq copied to clipboard
Idea: Update SSL docs and default config file
Hello! Love the package, thank you so much for all the work you do to keep it maintained!
I just got SSL setup in my environment and I ran into a situation that I thought might be useful for adding to either the docs or the default configuration.
When I work locally, I have a rabbitmq docker container, no SSL. My test and production environments use SSL for rabbit. So, for this to work, I'd have to switch the connection class name in the config between environments. Since I can't use the ::class syntax in a .env file, I just used the following ternary around a new .env variable:
'connection' => env('RABBITMQ_SSL', false) ? PhpAmqpLib\Connection\AMQPSSLConnection::class : PhpAmqpLib\Connection\AMQPLazyConnection::class,
At minimum, I'd like to update the docs to indicate that switching that connection class is how you enable SSL (wasn't clear to me when I first looked into enabling SSL), and either document the above as a solution if you have mixed SSL needs, or add it to the default configuration. I'm happy to make a PR for this, but before I jumped in with my opinions, I wanted to see if anyone else, especially the maintainer, agreed with the ideas.