-
Add project dependency:
composer require lizards-and-pumpkins/lib-queue-backend-amqp dev-master
-
Install RabbitMQ: e.g.
sudo apt-get install rabbitmq-server
-
Configure the access credentials in the environment (where ever you set your other Lizards & Pumpkins settings)
# insecure default example access credentials: export LP_AMQP_HOST="localhost" export LP_AMQP_PORT="5672" export LP_AMQP_USERNAME="guest" export LP_AMQP_PASSWORD="guest" export LP_AMQP_VHOST="/"
-
Add the same config settings to your www NGINX or Apache config
# insecure default example access credentials: fastcgi_param LP_AMQP_HOST "localhost"; fastcgi_param LP_AMQP_PORT "5672"; fastcgi_param LP_AMQP_USERNAME "guest"; fastcgi_param LP_AMQP_PASSWORD "guest"; fastcgi_param LP_AMQP_VHOST "/";
-
Register the
AmqpFactory
with theMasterFactory
instance, for example using the factory registration callback:public function factoryRegistrationCallback(MasterFactory $masterFactory) { $masterFactory->register(new \LizardsAndPumpkins\Messaging\Queue\Amqp\AmqpFactory()); }
Please be aware that in order to run RabbitMQ in production proper security measures have to be put in place, but that is out of the scope of this document.
Please refer to the access control and TLS RabbitMQ documentation for further information.