Service | Result |
---|---|
Travis CI (PHP 5.6 .. 7.1) | |
Scrutinizer | |
Code coverage | |
Packagist |
# amqp.yml
broker:
host: myRabbit
login: guest
password: guest
vhost: /
# app.yml
id: myApp
<?php
require '../vendor/autoload.php';
use Puzzle\Configuration\Memory;
use Puzzle\AMQP\Clients\Pecl;
use Puzzle\AMQP\Messages\Json;
$configuration = new Memory(array(
'amqp/broker/host' => 'myRabbit',
'amqp/broker/login' => 'guest',
'amqp/broker/password' => 'guest',
'amqp/broker/vhost' => '/',
'app/id' => 'myApp',
));
$client = new Pecl($configuration);
$message = new Json('my.routing.key');
$message->setBody([
'key' => 'value',
'key2' => 'value2',
]);
$client->publish('myExchange', $message);
2.x -> 3.x
- Namespace of MessageHook interface was changed
1.x -> 2.x
- Drop support for Silex 1.x (in favor of Silex 2.x)