Download the PHP package crazy-goat/rabbit-stream without Composer
On this page you can find all versions of the php package crazy-goat/rabbit-stream. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rabbit-stream
RabbitStream
A PHP library implementing the RabbitMQ Streams Protocol client.
It provides low-level TCP communication with a RabbitMQ broker over the native Stream protocol (port 5552), including binary frame serialization/deserialization.
Requirements
- PHP 8.1+, 64-bit build (stream offsets are uint64; see Requirements)
- RabbitMQ with the
rabbitmq_streamplugin enabled
Installation
Quick Start
Publishing
Message bodies are plain strings — Producer::send() and sendBatch()
automatically wrap them in an AMQP 1.0 Data section
on the wire, and the consumer returns them unwrapped (see Publishing).
TLS transport (encrypted connections)
By default connections are plaintext tcp:// (port 5552). Pass a
CrazyGoat\RabbitStream\VO\TlsConfig to use the encrypted ssl:// transport
(RabbitMQ stream listener on port 5551):
Peer certificate and hostname verification are on by default
(verify_peer/verify_peer_name). For a self-signed development broker you can
disable them explicitly — do not do this in production:
Consuming
Usage
High-level API (Recommended)
Consuming with Message Decoding
Consumer with Auto-Commit
Note:
autoCommittriggersstoreOffsetevery N messages. The offset is also stored onclose(). A named consumer is required for offset persistence — unnamed consumers cannot usestoreOffsetorqueryOffset.
See examples/consumer_auto_commit.php for a full working example.
Low-level Connection API
See examples/simple_publisher.php for a full working example.
Protocol Implementation Status
Protocol reference: https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_stream/docs/PROTOCOL.adoc
Connection & Authentication
| Command | Key | Request | Response |
|---|---|---|---|
| PeerProperties | 0x0011 | ✅ | ✅ |
| SaslHandshake | 0x0012 | ✅ | ✅ |
| SaslAuthenticate | 0x0013 | ✅ | ✅ |
| Tune | 0x0014 | ✅ | ✅ |
| Open | 0x0015 | ✅ | ✅ |
Publishing
| Command | Key | Request | Response |
|---|---|---|---|
| DeclarePublisher | 0x0001 | ✅ | ✅ |
| Publish | 0x0002 | ✅ | — |
| PublishConfirm | 0x0003 | — | ✅ |
| PublishError | 0x0004 | — | ✅ |
| QueryPublisherSequence | 0x0005 | ✅ | ✅ |
| DeletePublisher | 0x0006 | ✅ | ✅ |
Consuming
| Command | Key | Request | Response |
|---|---|---|---|
| Subscribe | 0x0007 | ✅ | ✅ |
| Deliver | 0x0008 | — | ✅ |
| Credit | 0x0009 | ✅ | ✅ |
| StoreOffset | 0x000a | ✅ | — |
| QueryOffset | 0x000b | ✅ | ✅ |
| Unsubscribe | 0x000c | ✅ | ✅ |
| ConsumerUpdate | 0x001a | ✅ | ✅ |
Stream Management
| Command | Key | Request | Response |
|---|---|---|---|
| Create | 0x000d | ✅ | ✅ |
| Delete | 0x000e | ✅ | ✅ |
| Metadata | 0x000f | ✅ | ✅ |
| MetadataUpdate | 0x0010 | — | ✅ |
| CreateSuperStream | 0x001d | ✅ | ✅ |
| DeleteSuperStream | 0x001e | ✅ | ✅ |
| StreamStats | 0x001c | ✅ | ✅ |
Routing (Super Streams)
| Command | Key | Request | Response |
|---|---|---|---|
| Route | 0x0018 | ✅ | ✅ |
| Partitions | 0x0019 | ✅ | ✅ |
Connection Management
| Command | Key | Request | Response |
|---|---|---|---|
| Close | 0x0016 | ✅ | ✅ |
| Heartbeat | 0x0017 | ✅ | — |
| ExchangeCommandVersions | 0x001b | ✅ | ✅ |
| ResolveOffsetSpec | 0x001f | ✅ | ✅ |
Legend: ✅ implemented, ❌ not implemented, — not applicable (one-direction command)