Download the PHP package innmind/amqp without Composer
On this page you can find all versions of the php package innmind/amqp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package amqp
Short Description AMQP client
License MIT
Homepage http://github.com/Innmind/AMQP
Informations about the package amqp
AMQP
This is an AMQP client implementing the version 0.9
of the protocol.
The goal of this implementation is to provide a PHP land implementation (for ease of use and readability) with a clear separation between the AMQP Model, transport layer and user API.
Note: This implementation couldn't have been done without php-amqplib
that helped a lot to figure out the details of the transport layer.
Important: If you are using RabbitMQ be aware that it doesn't implemented the specification completely, Qos
and Recover
methods are not implemented. And if you find yourself using Value
implementations note that ShortString
, SignedLongLongInteger
and SignedShortInteger
generate server errors on some methods (like using them as message headers).
Documentation
Important: you must use vimeo/psalm
to make sure you use this library correctly.
Installation
Usage
The above example will declare an exchange named crawler
and queue parser
that will receive messages from our exchange. Finally it will publish a message with the payload http://github.com/
to crawler
(and the server will route it to parser
).
And to consume the messages you have 2 approaches:
reject()
and requeue()
can also be used in the get
callback.
Feel free to look at the Command
namespace to explore all capabilities.
Benchmarks
make benchmark
run on a MacBookPro18,2 (M1 Max, 32Gb RAM) with a RabbitMQ running in a container (via docker for mac) produces this result:
By comparison, the php-amqplib
produces this result:
So it appears pure functions come at a cost!
Note: both benchmarks use manual acknowledgement of messages
All versions of amqp with dependencies
innmind/immutable Version ~5.7
innmind/time-continuum Version ~3.1
innmind/math Version ~6.0
innmind/url Version ~4.1
ramsey/uuid Version ~4.0
innmind/operating-system Version ~5.0
innmind/media-type Version ~2.0
innmind/filesystem Version ~7.0
innmind/stream Version ~4.0
innmind/io Version ~2.6