Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor readme updates #114

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ PHP 7.4 AMQP library

## Overview

PHP 7.4 AMQP libray supporting multiple drivers and providing full-featured Consumer, Producer, and JSON-RPC Client / Server implementations.
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](http://www.jsonrpc.org/specification).

Current supported drivers are: [php-amqp](https://github.com/pdezwart/php-amqp) and [PhpAmqpLib](https://github.com/php-amqplib/php-amqplib).

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

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

Expand All @@ -37,23 +37,22 @@ You can install prolic/humus-amqp via composer by adding `"prolic/humus-amqp": "

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

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

$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();
Expand Down Expand Up @@ -84,20 +83,19 @@ This is a slight BC break, but the old behaviour was so problematic, that I had

### 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.
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).
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()`
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

Expand Down