Unified API
publish, receive, consume, ack and reject share one calling convention.
Messaging / PHP
Pure PHP publish, receive and ack across 20 systems, 13 protocol stacks and 6 frameworks.
messaging-php implements publishing and consumption in pure PHP: TCP uses stream_socket_client, cloud APIs use Guzzle, and no broker SDK or extension is required.
Twenty product names collapse into 13 protocol stacks. Switching brokers usually means changing the driver and connection config while business code stays the same.
A round light-blue and white robot messenger with cyan pixel eyes on a dark screen, a blue paper-plane antenna, a PHP-purple scarf, and a chest mail slot with three blue, teal and purple status lights, waving its right hand.
Signal strong, message delivered.One contract, explicit capabilities and pure-PHP transports across brokers.
publish, receive, consume, ack and reject share one calling convention.
TCP runs on stream_socket_client, with protocol codecs written in PHP.
capabilities() answers at runtime; unsupported features throw instead of degrading silently.
Laravel, ThinkPHP, webman, Hyperf, Yii2 and Yii3; Composer copies each framework config on install.
default plus connections config, cached by name, with disconnect() for reconnects.
742 unit/protocol tests plus fake-broker, contract and heavy Docker integration matrices.
Four recent driver milestones, from P2 to P5.
RocketMQ heartbeat/offsets, Manager reconnect, Pulsar compatibility and CI hardening.
Composer plugin copies config per framework; Yii3 merges automatically.
Pulsar and RocketMQ complete the full 20-system coverage.
Kafka, Redpanda, AutoMQ, Confluent and Event Hubs share one protocol stack.
Click an image to enlarge.
Install, then publish, receive and ack with Redis Streams.
composer config allow-plugins.erikwang2013/messaging-php true
composer require erikwang2013/messaging-phpuse Erikwang2013\Messaging\Contract\Message;
use Erikwang2013\Messaging\Contract\ReceiveOptions;
use Erikwang2013\Messaging\Manager;
$mq = new Manager([
'default' => 'redis',
'connections' => [
'redis' => [
'driver' => 'redis',
'host' => '127.0.0.1',
'port' => 6379,
'group' => 'orders',
],
],
]);
$connection = $mq->connection();
$connection->publish('orders', Message::json(['id' => 1]));
while ($message = $connection->receive('orders', new ReceiveOptions(timeoutMs: 5000))) {
$message->ack();
}Every expression has a subtle animation; hover to watch.