Download the PHP package func0der/humus-amqp without Composer

On this page you can find all versions of the php package func0der/humus-amqp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package humus-amqp

Humus Amqp

Please be aware that this is merely a mirror of prolic/humus-amqp. I merely created this copy to publish a newer version of the library to packagist. I do not plan to actively maintain it.

PHP 7.4/8.x AMQP library

Build Status Coverage Status Gitter Documentation Status

Documentation powered by Read the Docs.

Overview

PHP 7.4 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.11.0

This library ships with psr/container factories that help you setting up everything.

Zend Framework and Symfony Framework Integration

Installation

You can install prolic/humus-amqp via composer by adding "prolic/humus-amqp": "^2.0" 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.

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.


All versions of humus-amqp with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
beberlei/assert Version ^3.2.7
marc-mabe/php-enum Version ^4.2
psr/log Version ^1.0 || ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package func0der/humus-amqp contains the following files

Loading the files please wait ....