hanaboso/rabbit-mq-bundle

Hanaboso - rabbit-mq-bundle

1.8.0 2024-06-19 15:49 UTC

README

Build Status Coverage Status PHPStan Downloads

Installation

  • Download package via composer
composer require hanaboso/rabbit-mq-bundle

Logger

  • default stdout logger - monolog.logger.rabbit_mq

Config

rabbit_mq:
    logger: 'monolog.logger.rabbit_mq'
    connections:
        default:
            dsn: amqp://rabbitmq:5672/

    queues:
        my-queue:
            arguments:
                my-arg: 'my-value'
            bindings:
                - exchange: 'my-exchange'
                  routing_key: 'routing-key'
                  arguments:
                    my-arg: 'my-value'
        my-safe-queue:
            durable: true
            arguments:
                x-queue-type: 'quorum'

    exchanges:
        my-exchange:
            type: 'direct'
            passive: false
            durable: false
            auto_delete: false
            internal: false
            no_wait: false
            arguments:
                my-arg: 'my-value'
            bindings:
               - exchange: 'my-exchange'
                 routing-key: 'routing-key'
                 arguments:
                    my-arg: 'my-value'

    publishers:
       my-publisher:
            routing_key: 'routing-key' # queue name or routing key
            exchange: 'my-exchange'
        my-safe-publisher:
            routing_key: 'routing-key'
            exchange: 'my-exchange'
            persistent: true
            acknowledge: true

    consumers:
        my-consumer:
            queue: 'my-queue'
            callback: rabbit_mq.null_callback