All Projects → prolic → Humusamqp

prolic / Humusamqp

Licence: mit
PHP 7 AMQP library

Projects that are alternatives of or similar to Humusamqp

Servicebus
Simple service bus for sending events between processes using amqp.
Stars: ✭ 415 (+492.86%)
Mutual labels:  rabbitmq, messaging, amqp
Rabbitmqbundle
RabbitMQ Bundle for the Symfony2 web framework
Stars: ✭ 1,125 (+1507.14%)
Mutual labels:  rabbitmq, messaging, amqp
Bunny
Bunny is a popular, easy to use, mature Ruby client for RabbitMQ
Stars: ✭ 1,224 (+1648.57%)
Mutual labels:  rabbitmq, messaging, amqp
Php Amqplib
The most widely used PHP client for RabbitMQ
Stars: ✭ 3,950 (+5542.86%)
Mutual labels:  rabbitmq, messaging, amqp
Remit
RabbitMQ-backed microservices supporting RPC, pubsub, automatic service discovery and scaling with no code changes.
Stars: ✭ 24 (-65.71%)
Mutual labels:  rabbitmq, messaging, amqp
Garagemq
AMQP message broker implemented with golang
Stars: ✭ 153 (+118.57%)
Mutual labels:  rabbitmq, messaging, amqp
Rabbitmq Server
Open source RabbitMQ: core server and tier 1 (built-in) plugins
Stars: ✭ 9,064 (+12848.57%)
Mutual labels:  rabbitmq, messaging, amqp
Amqp
Go client for AMQP 0.9.1
Stars: ✭ 4,170 (+5857.14%)
Mutual labels:  rabbitmq, amqp
Azure Service Bus
☁️ Azure Service Bus service issue tracking and samples
Stars: ✭ 472 (+574.29%)
Mutual labels:  messaging, amqp
Machinery
Machinery is an asynchronous task queue/job queue based on distributed message passing.
Stars: ✭ 5,821 (+8215.71%)
Mutual labels:  rabbitmq, amqp
Aio Pika
AMQP 0.9 client designed for asyncio and humans.
Stars: ✭ 611 (+772.86%)
Mutual labels:  rabbitmq, amqp
Node Celery
Celery client for Node.js
Stars: ✭ 648 (+825.71%)
Mutual labels:  rabbitmq, amqp
Activemq Artemis
Mirror of Apache ActiveMQ Artemis
Stars: ✭ 685 (+878.57%)
Mutual labels:  messaging, amqp
Lapin
AMQP client library in Rust, with a clean, futures based API
Stars: ✭ 497 (+610%)
Mutual labels:  messaging, amqp
Hyperf
🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.
Stars: ✭ 4,206 (+5908.57%)
Mutual labels:  json-rpc, amqp
Masstransit
Distributed Application Framework for .NET
Stars: ✭ 4,103 (+5761.43%)
Mutual labels:  rabbitmq, messaging
Yii2 Queue
Yii2 Queue Extension. Supports DB, Redis, RabbitMQ, Beanstalk and Gearman
Stars: ✭ 977 (+1295.71%)
Mutual labels:  rabbitmq, amqp
Yii Queue
Queue extension for Yii 3.0
Stars: ✭ 38 (-45.71%)
Mutual labels:  rabbitmq, amqp
Stompjs
Javascript and Typescript Stomp client for Web browsers and node.js apps
Stars: ✭ 324 (+362.86%)
Mutual labels:  rabbitmq, messaging
Pg Amqp Bridge
Send messages to RabbitMQ from PostgreSQL
Stars: ✭ 334 (+377.14%)
Mutual labels:  rabbitmq, amqp

Humus Amqp

PHP 7 AMQP library

Build Status Coverage Status Gitter Documentation Status

Documentation powered by Read the Docs.

Overview

PHP 7 AMQP libray supporting multiple drivers and providing full-featured Consumer, Producer, and JSON-RPC Client / Server implementations.

The JSON-RPC part implements JSON-RPC 2.0 Specification.

Current supported drivers are: php-amqp and PhpAmqpLib.

php-amqp needs at least to be v1.9.3 php-amqplib needs at least to be v2.7.1

This library ships with container-interop factories that help you setting up everything.

Installation

You can install prolic/humus-amqp via composer by adding "prolic/humus-amqp": "^1.1" as requirement to your composer.json.

Usage

Exchange

$exchangeName = 'test-exchange';
$exchange = ExchangeFactory::$exchangeName($container);

$exchange->publish('test-message');

Queue

$queueName = 'test-queue';
$queue = QueueFactory::$queueName($container);

$message = $queue->get();
$queue->ack($message->getDeliveryTag());

Producer

$producerName = 'test-producer';
$producer = ProducerFactory::$producerName($container);

$producer->confirmSelect();
$producer->publish(['foo' => 'bar'], 'my-routing-key');
$producer->waitForConfirm();

JSON RPC Client

$clientName = 'my-client';
$client = JsonRpcClientFactory::$clientName($container);
$client->addRequest(new JsonRpcRequest('my-server', 'method', ['my' => 'params'], 'id-1'));
$client->addRequest(new JsonRpcRequest('my-server', 'method', ['my' => 'other_params'], 'id-2'));
$responseCollection = $client->getResponseCollection();

JSON RPC Server

$serverName = 'my-server';
$server = JsonRpcServerFactory::$serverName($container);
$server->consume();

Notes

Upgrade from 1.x to 1.4

Before: If auto_setup_fabric was enabled, the queue and exchange binding was done automatically. The exchanges would also get created. Anonymous queues required to have auto_setup_fabric set to true.

New: If auto_setup_fabric is enabled or the queue is anonymous (has no name), the queue gets created and binding is done, but no exchanges are created. If you want to enable creating of depending exchanges (including exchange binding), set the new argument auto_setup_exchanges to true.

This is a slight BC break, but the old behaviour was so problematic, that I had to make this change either way.

AMQP-Extension

  1. We recommend using php-amqp >=v1.9.3 or compiling it from master, if you encounter any problems with the amqp extension, check their issue tracker, first.

The ext-amqp driver is the most performant. Benchmarks are added soon.

PhpAmqpLib

  1. When using php-amqplib as driver, it's worth point out, that a StreamConnection (same goes for SSLConnection) does not have the possibility to timeout. If you want to let the consumer timeout, when no more messages are received, you should use the SocketConnection instead (assuming you don't need an SSL connection).

  2. When using php-amqplib as driver and you're using the LazyConnection, you should not create the channel yourself, call instead $channel = $connection->newChannel()

Support

Contribute

Please feel free to fork and extend existing or add new plugins and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.

License

Released under the MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].