PHP code example of fiunchinho / rabbitmq-service-provider
1. Go to this page and download the library: Download fiunchinho/rabbitmq-service-provider library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fiunchinho / rabbitmq-service-provider example snippets
$app->post('/message', function(Request $request) use ($app){
$producer = $app['rabbit.producer']['my_exchange_name'];
$producer->publish('Some message');
return new Response($msg_body);
});
use Silex\Application;
use fiunchinho\Silex\Provider\RabbitServiceProvider;
$app = new Application();
$app->register(new RabbitServiceProvider());