stream-lib/rabbitmq-super-stream-legacy

PHP 5.6-compatible client for publishing to RabbitMQ Super Streams via an internal Go helper.

Maintainers

Package info

github.com/standard-librarian/rabbitmq-super-stream-legacy

pkg:composer/stream-lib/rabbitmq-super-stream-legacy

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-06-14 08:41 UTC

This package is auto-updated.

Last update: 2026-06-15 09:10:21 UTC


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.1 TCP 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, and stream_socket_client
  • openssl or PHP random_bytes() support for secure helper request ids and auth tokens
  • Supported bundled helper targets:
    • linux-amd64
    • linux-arm64
    • darwin-amd64
    • darwin-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:

  • host
  • port
  • username
  • password
  • vhost
  • super_stream
  • use_tls
  • verify_tls
  • tls_server_name
  • connect_timeout_ms
  • confirm_timeout_ms
  • helper_rpc_timeout_ms
  • helper_startup_timeout_ms
  • helper_shutdown_timeout_ms
  • helper_max_queue_size
  • helper_transport_preference
  • helper_runtime_dir
  • helper_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