PHP code example of semako / rabbitmq-service-provider
1. Go to this page and download the library: Download semako/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/ */
semako / 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());