Download the PHP package stream-lib/rabbitmq-super-stream without Composer
On this page you can find all versions of the php package stream-lib/rabbitmq-super-stream. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stream-lib/rabbitmq-super-stream
More information about stream-lib/rabbitmq-super-stream
Files in stream-lib/rabbitmq-super-stream
Package rabbitmq-super-stream
Short Description PHP client for publishing to RabbitMQ Super Streams via an internal Go helper.
License MIT
Homepage https://github.com/standard-librarian/rabbitmq-super-stream
Informations about the package rabbitmq-super-stream
RabbitMQ Super Stream Publisher for PHP
stream-lib/rabbitmq-super-stream gives PHP applications a native-feeling API for publishing to RabbitMQ Super Streams while delegating stream-specific work to an internal Go helper binary.
The PHP package is the public surface. The Go helper is an implementation detail that is started and managed automatically.
Features
- Native PHP API with no FFI and no custom PHP extension
- RabbitMQ Super Stream publishing powered by the official Go stream client
- Local HTTP+JSON protocol over Unix domain sockets when available
- Automatic fallback to
127.0.0.1TCP for local helper transport - Helper reuse across PHP requests per effective config hash
- Connects to an existing RabbitMQ super stream; production code does not declare streams
- Publish confirmations, helper health checks, retries, and structured error mapping
- Plain PHP and Laravel integration
Requirements
- PHP
^8.2 proc_open,flock,json, andstream_socket_client- Supported bundled helper targets:
linux-amd64linux-arm64darwin-amd64darwin-arm64
Windows is not supported in v1. The protocol already supports TCP fallback, so Windows support can be added later without changing the public PHP API.
Installation
End users do not need Go installed if they use one of the bundled binary targets above.
If you want to override the bundled helper binary:
Basic Usage
publish() waits for broker confirmation by default and throws a typed PHP exception on failure.
Configuration
Supported options:
hostportusernamepasswordvhostsuper_streamuse_tlsverify_tlstls_server_nameconnect_timeout_msconfirm_timeout_mshelper_rpc_timeout_mshelper_startup_timeout_mshelper_shutdown_timeout_mshelper_max_queue_sizehelper_transport_preferencehelper_runtime_dirhelper_binary
The helper endpoint is managed internally by the library. Normal application configuration should not set it.
Laravel
The package includes a Laravel service provider and facade. See examples/laravel.md.
Internal Architecture
- PHP resolves or launches one helper per config hash.
- The helper listens on a Unix socket when it can. If not, it binds a random localhost TCP port.
- By default on Unix hosts, helper runtime files live under
/tmp/ssrsto keep Unix socket paths short enough for macOS and Linux limits. - PHP talks to the helper with raw HTTP+JSON over
stream_socket_client. - The helper owns one RabbitMQ environment and a per-partition producer set for the configured super stream.
- On startup, the helper queries the configured super stream partitions and connects only to the partitions that already exist.
- Publish requests are serialized through a bounded in-memory queue.
- Confirmation callbacks map broker confirms back to the originating PHP request id.
Local Development
-
Install PHP dependencies:
-
Build the helper for your local machine:
-
Start RabbitMQ:
-
Run unit tests:
-
Run integration tests:
- Run the end-to-end example:
Troubleshooting
HelperBinaryNotFoundException:- Build the helper with
make build-helperor pointSUPER_STREAM_HELPER_BINARYat a valid binary.
- Build the helper with
HelperStartupException:- Inspect the helper log in the runtime directory. By default this is
/tmp/ssrson Unix hosts.
- Inspect the helper log in the runtime directory. By default this is
AuthenticationException:- Check RabbitMQ stream credentials and vhost permissions.
PublishIndeterminateException:- The helper could not prove whether the broker confirmed the publish before the timeout. Your application should treat this as potentially published and make its own idempotency decision.
- Stale runtime files:
- Remove the relevant runtime directory under
/tmp/ssrson Unix, or your configuredhelper_runtime_dir.
- Remove the relevant runtime directory under
Packaging Notes
- End users consume the package through Composer.
- The Go helper is bundled as a standalone binary.
scripts/release-binaries.shcross-compiles the supported targets and places them underresources/bin/....scripts/package-release-assets.shcreates.tar.gzrelease assets plusSHA256SUMSfrom the bundled helper binaries.
Publishing To Packagist
-
Sign in to Packagist and submit the GitHub repository URL:
-
After the package is created on Packagist, copy your Packagist API token from your Packagist profile.
-
Add a GitHub webhook on this repository:
-
Keep SSL verification enabled and use the default push event.
- For every new package version:
Packagist should auto-update from the webhook. If it does not, use the package page on Packagist and trigger a manual update.
Verification Summary
The repo includes:
- PHP unit tests for config validation, binary resolution, manifest persistence, transport framing, and helper error mapping
- Go unit tests for config validation, manifest writing, and stream error mapping
- Docker-based integration tests that declare a super stream, publish through PHP, and verify the message is observable through a Go consumer