hkuan/mq

From AMQP adapter to php-amqplib

dev-master 2017-05-27 02:01 UTC

This package is not auto-updated.

Last update: 2025-05-25 06:48:36 UTC


README

From AMQP adapter to php-amqplib,This package is used for projects "haoshiqi"

Install

If you have Composer, just include Macaw as a project dependency in your composer.json. If you don't just install it by downloading the .ZIP file and extracting it to your project directory.

require: {
    "hkuan/amqp_adapterr": "dev-master"
}

Examples

First, use the Macaw namespace:

producer:

use \Hkuan\Mq\Amqadapter;
DWDMq::getInstance()->send('test','2222');
consumer:
use \Hkuan\Mq\Amqadapter;
DWDMq::getInstance()->get('test', 'deal');

$i = 1;
function deal($envelope, $queue) {
    $msg = $envelope->getBody();
    echo $msg.PHP_EOL;   
}