rabbitmq-transfer

command module
v0.0.0-...-2b10ae3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 12 Imported by: 0

README

RabbitMQ

A tool to test RabbitMQ connections, and consume/publish/transfer messages between queues. The mode of operation and other parameters are configured using a simple YAML configuration file.

Consume and Produce

  • Connect to RabbitMQ Broker
  • Consume messages from a queue
  • Produce messages to a queue

Transfer queue messages

In this mode, all messages that weren't consumed by any client will replicated to another RabbitMQ Server.

Compare queue size

In this mode, the command will compare the validation of the queue length between RabbitMQ Servers.

Usage

  • Start a local RabbitMQ server
$ docker-compose up

Access the local RabbitMQ Manager: http://localhost:15672

login with guest username and password

  • Building a binary file
go build

It's necessary write a config.yaml file to start the tool

example:

---
rabbitmq: 
  amqp_url: amqp://guest:guest@localhost:5672
  queue_name: queue-name-1
  • Consume some queue
./rabbitmq --consume
  • Produce a message in some queue
./rabbitmq --producer message
  • Transfer data between RabbitMQ Servers

First step is configure transfer.yaml file

  • example:
servers:
  source: rabbitmq-server-1:5672
  dest: rabbitmq-server-2:5672
vhosts: 
  - name: vhost_name_1
    queues: 
      - name: queue-1
        exchange_letter: queue-4.deadletter
      - name: queue-2
        routing_key: routing-key-value
      - name: queue-3
      - name: queue-4
        routing_key: ""
        exchange_letter: queue-4.deadletter
  - name: vhost_name_2
    queues:
      - name: queue-name-6
      - name: queue-name-5
        routing_key: routing-key-value
      - name: queue-name-7
        exchange_letter: queue-7.deadletter
  • Running
  • Transfer
./rabbitmq --transfer

These settings will connect into the source server and from each vhost will copy all messages from the queues to their respectives in the destination server.

  • Compare
./rabbitmq --compare
  • Diffs

This command will only return the diff of the settings between source and destination servers

./rabbitmq --diff

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL