stream-lib/rabbitmq-super-stream-legacy
Composer 安装命令:
composer require stream-lib/rabbitmq-super-stream-legacy
包简介
PHP 5.6-compatible client for publishing to RabbitMQ Super Streams via an internal Go helper.
README 文档
README
stream-lib/rabbitmq-super-stream-legacy is the PHP 5.6-compatible sibling of stream-lib/rabbitmq-super-stream.
It keeps the same core idea: PHP applications get a small publishing API, while stream-specific RabbitMQ work is delegated to a bundled Go helper binary.
The modern package remains the recommended package for PHP 8.2+ applications. Use this legacy package only when an application must run on PHP 5.6.
Features
- PHP 5.6-compatible plain PHP API
- 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
Laravel integration is intentionally not included in the first legacy release.
Requirements
- PHP
>=5.6 proc_open,flock,json, andstream_socket_clientopensslor PHPrandom_bytes()support for secure helper request ids and auth tokens- Supported bundled helper targets:
linux-amd64linux-arm64darwin-amd64darwin-arm64
Windows is not supported in v1.
Installation
composer require stream-lib/rabbitmq-super-stream-legacy
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:
export SUPER_STREAM_HELPER_BINARY=/absolute/path/to/rabbitmq-super-stream-helper
Basic Usage
<?php use StreamLib\RabbitMqSuperStream\SuperStreamClient; $client = new SuperStreamClient(array( 'host' => 'rabbitmq', 'port' => 5552, 'username' => 'guest', 'password' => 'guest', 'vhost' => '/', 'super_stream' => 'orders', )); $result = $client->publish( json_encode(array('order_id' => 123)), 'customer-123', 'msg-123', array(), 'application/json' );
publish() waits for broker confirmation by default and throws a typed PHP exception on failure.
Configuration
Supported options match the modern package:
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.
Local Development
composer install
make build-helper
composer test
make go-test
Integration tests require RabbitMQ Streams:
docker compose -f docker/compose.yml up -d ./docker/setup.sh RUN_STREAM_INTEGRATION_TESTS=1 \ SUPER_STREAM_HELPER_BINARY=$PWD/resources/bin/$(go env GOOS)-$(go env GOARCH)/rabbitmq-super-stream-helper \ composer test:integration
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-15