Skip to content

makasim/rabbitmq-cli-consumer-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Queue Interop based wrapper for rabbitmq-cli-consumer.

Usage

composer makasim/php-fpm-queue:0.1.x-dev queue-interop/queue-interop:0.7.x-dev queue-interop/amqp-interop:0.8.x-dev

An executable:

<?php
#!/usr/bin/env php
# executable.php

use Makasim\RabbitmqCliConsumer\RabbitmqCliConsumerConnectionFactory;

require_once __DIR__.'/vendor/autoload.php';

$context = (new RabbitmqCliConsumerConnectionFactory())->createContext();

$queue = $context->createQueue($argv[1]);
$consumer = $context->createConsumer($queue);

if ($message = $consumer->receiveNoWait()) {
    // process message

    $consumer->acknowledge($message);
    
    // or
    //$consumer->reject($message);
}

Run

rabbitmq-cli-consumer --verbose --url amqp://guest:guest@localhost --include --pipe --queue myqueue --executable "executable.php myqueue"

License

MIT License

About

Queue Interop based client for rabbitmq-cli-consumer.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages