2017 © Pedro Peláez
 

symfony-bundle rabbit-mq-admin-toolkit-bundle

Automate rabbitmq vhost's configuration creation / update

image

olaurendeau/rabbit-mq-admin-toolkit-bundle

Automate rabbitmq vhost's configuration creation / update

  • Monday, April 10, 2017
  • by olaurendeau
  • Repository
  • 1 Watchers
  • 1 Stars
  • 24,734 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 10 % Grown

The README.md

RabbitMqAdminToolkitBundle

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight, (*1)

License Latest Stable Version Total Downloads Monthly Downloads, (*2)

Automate rabbitmq vhost's configuration creation / update, (*3)

Installation

composer require olaurendeau/rabbit-mq-admin-toolkit-bundle

Add RabbitMqAdminToolkitBundle to your bundles, (*4)

    // config/bundles.php
<?php

return [
    ...
    Ola\RabbitMqAdminToolkitBundle\OlaRabbitMqAdminToolkitBundle::class => ['all' => true]
    ...
];

Update your configuration, (*5)

# config/packages/ola_rabbit_mq_admin_toolkit.yaml
ola_rabbit_mq_admin_toolkit:
    delete_allowed: true # Allow deletion of exchange, queues and binding for updating configuration. Shouldn't be enabled in production
    connections:
        default: http://user:password@localhost:15672
    vhosts:
        default:
            name: /my_vhost
            permissions:
                user: ~
            exchanges:
                exchange.a: ~
            queues:
                queue.a:
                    bindings:
                        - { exchange: exchange.a, routing_key: "a.#" }
                        - { exchange: exchange.a, routing_key: "b.#" }

Usage

Simply run app/console rabbitmq:vhost:define., (*6)

Configuration sample

See app/console config:dump-reference OlaRabbitMqAdminToolkitBundle for full configuration possibilities, (*7)

# config/packages/ola_rabbit_mq_admin_toolkit.yaml
ola_rabbit_mq_admin_toolkit:
    delete_allowed: true # Allow deletion of exchange, queues and binding for updating configuration. Shouldn't be enabled in production
    default_vhost: test # default is "default"
    silent_failure: true # Catch all exceptions in commands. Could be use in test environment if no rabbitmq available
    connections:
        default: http://user:password@localhost:15672
        vm: http://user:password@192.168.1.1:15672
    vhosts:
        test:
            name: /test
            connection: vm # default is "default"
            permissions:
                user: ~
            exchanges:
                exchange.a:
                    durable: false # default is "true"
                exchange.b:
                    type: direct # default is "topic"
                exchange.c: ~
            queues:
                queue.a:
                    durable: false # default is "true"
                    arguments: # define arguments 
                        x-message-ttl: 5000
                    bindings:
                        - { exchange: exchange.a, routing_key: "a.#" }
                        - { exchange: exchange.b, routing_key: "b.#" }
                queue.b:
                    bindings:
                        - { exchange: exchange.a, routing_key: "a.#" }
                        - { exchange: exchange.b, routing_key: "b.#" }
                        - { exchange: exchange.c, routing_key: "c.#" }
                queue.c:
                    bindings:
                        - { exchange: exchange.a, routing_key: "a.#" }
                        - { exchange: exchange.c, routing_key: "c.#" }

Sharding queues

Sharding queues can be useful to process huge amount of messages., (*8)

# config/packages/ola_rabbit_mq_admin_toolkit.yaml
ola_rabbit_mq_admin_toolkit:
    delete_allowed: true # Allow deletion of exchange, queues and binding for updating configuration. Shouldn't be enabled in production
    connections:
        default: http://user:password@localhost:15672
    vhosts:
        default:
            name: /my_vhost
            permissions:
                user: ~
            exchanges:
                exchange.a: ~
            queues:
                queue.a.sharded:
                    name: "queue.a.{modulus}"
                    modulus: 5
                    bindings:
                        - { exchange: exchange.a, routing_key: "a.{modulus}.#" }
                        - { exchange: exchange.a, routing_key: "b.#" }

It will produce the following configuration :, (*9)

capture d ecran 2016-02-10 a 09 56 19, (*10)

capture d ecran 2016-02-10 a 09 56 33, (*11)

The Versions

10/04 2017

dev-feature/one-define-to-rule-all-vhosts

dev-feature/one-define-to-rule-all-vhosts

Automate rabbitmq vhost's configuration creation / update

  Sources   Download

MIT

The Requires

 

The Development Requires

by Olivier Laurendeau

12/02 2016

v1.2.1

1.2.1.0

Automate rabbitmq vhost's configuration creation / update

  Sources   Download

MIT

The Requires

 

The Development Requires

by Olivier Laurendeau

11/02 2016

v1.2.0

1.2.0.0

Automate rabbitmq vhost's configuration creation / update

  Sources   Download

MIT

The Requires

 

The Development Requires

by Olivier Laurendeau

10/02 2016

v1.1.0

1.1.0.0

Automate rabbitmq vhost's configuration creation / update

  Sources   Download

MIT

The Requires

 

The Development Requires

by Olivier Laurendeau

01/02 2016

v1.0.2

1.0.2.0

Automate rabbitmq vhost's configuration creation / update

  Sources   Download

MIT

The Requires

 

The Development Requires

by Olivier Laurendeau

01/02 2016

v1.0.1

1.0.1.0

Automate rabbitmq vhost's configuration creation / update

  Sources   Download

MIT

The Requires

 

The Development Requires

by Olivier Laurendeau

31/01 2016

v1.0

1.0.0.0

Automate rabbitmq vhost's configuration creation / update

  Sources   Download

MIT

The Requires

 

The Development Requires

by Olivier Laurendeau