Search by

freyr / message-broker-transport-amqp

Freyr

AMQP (RabbitMQ) transport adapter for freyr/message-broker: outbox relay publisher and consumer

Package info

github.com/freyr/message-broker-transport-amqp

pkg:composer/freyr/message-broker-transport-amqp

Statistics

Installs: 2

Dependents: 1

Suggesters: 1

Stars: 0

v0.1.0 2026-11-23 21:31 UTC

This package is auto-updated.

Last update: 2026-11-23 21:48:52 UTC


README

This package is the AMQP (RabbitMQ) transport adapter of the Freyr Message Broker library, namespace Freyr\MessageBroker\Transport\Amqp\.

The repository freyr/message-broker-transport-amqp is a read-only copy of the folder transport/amqp/ of freyr/message-broker. Development, issues and pull requests are in freyr/message-broker. A release has the tag transport-amqp-v<version> in freyr/message-broker and the tag v<version> in freyr/message-broker-transport-amqp.

The adapter holds the publisher that sends outbox rows to an exchange, the consumer loop that gives each delivery to the core delivery processor, the TTL wait queues of the retry, and the config classes. It routes by message name and gives no ordering guarantee.

Requirements

  • PHP 8.4 or later
  • freyr/message-broker ^0.15 (the core)
  • php-amqplib/php-amqplib ^3.7.2
  • psr/log ^3.0
  • A storage adapter for the outbox, deduplication and dead letters, for example freyr/message-broker-storage-postgresql

Install

composer require freyr/message-broker-transport-amqp

Minimal wiring

use Freyr\MessageBroker\Transport\Amqp\AmqpConsumer;
use Freyr\MessageBroker\Transport\Amqp\AmqpMessagePublisher;
use Freyr\MessageBroker\Transport\Amqp\AmqpPublishConfig;
use Freyr\MessageBroker\Transport\Amqp\AmqpQueueConfig;
use Freyr\MessageBroker\Outbox\Relay;
use Freyr\MessageBroker\Serializer\JsonWireFormat;

// Each relay worker and each consumer owns its own dedicated AMQPChannel.
$publisher = new AmqpMessagePublisher(
    $relayChannel,
    new AmqpPublishConfig(exchange: 'orders'),
    JsonWireFormat::CONTENT_TYPE,
);
$relay = new Relay(outbox: $outboxStore, publisher: $publisher, lane: 'orders');

// $processor is a DeliveryProcessor of the core.
$consumer = new AmqpConsumer(
    channel: $consumerChannel,
    queue: new AmqpQueueConfig('orders_q'),
    processor: $processor,
);

Documents