An easy-to-use CLI client for RabbitMQ.

Related tags

Messaging buneary
Overview

buneary

buneary, pronounced bun-ear-y, is an easy-to-use RabbitMQ command line client for managing exchanges, managing queues and publishing messages to exchanges.


buneary


Contents

Example

In the following example, a message Hello! is published and sent to an exchange called my-exchange. The RabbitMQ server is running on the local machine, and we'll use a routing key called my-routing-key for the message.

$ buneary publish localhost my-exchange my-routing-key "Hello!"

Since the RabbitMQ server listens to the default port, the port can be omitted here. The above command will prompt you to type in the username and password, but you could do this using command options as well.

Installation

macOS/Linux

Download the latest release for your platform. Extract the downloaded binary into a directory like /usr/local/bin. Make sure the directory is in PATH.

Windows

Download the latest release, create a directory like C:\Program Files\buneary and extract the executable into that directory. Add the directory to Path.

Docker

Just append the actual buneary command you want to run after the image name.

Because buneary needs to dial the RabbitMQ server, the Docker container needs to be in the same network as the RabbitMQ server. For example, if the server is running on your local machine, you could run a command as follows:

$ docker container run --network=host dominikbraun/buneary version

Usage

Create an exchange

Syntax:

$ buneary create exchange 
[flags]

Arguments:

Argument Description
ADDRESS The RabbitMQ server address. If no port is specified, 5672 is used.
NAME The desired name of the new exchange.
TYPE The exchange type. Has to be one of direct, headers, fanout and topic.

Flags:

Flag Short Description
--user -u The username to connect with. If not specified, you will be asked for it.
--password -p The password to authenticate with. If not specified, you will be asked for it.
--auto-delete Automatically delete the exchange once there are no bindings left.
--durable Make the exchange persistent, surviving server restarts.
--internal Make the exchange internal.

Example:

Create a direct exchange called my-exchange on a RabbitMQ server running on the local machine.

$ buneary create exchange localhost my-exchange direct

Create a queue

Syntax:

$ buneary create queue 
[flags]

Arguments:

Argument Description
ADDRESS The RabbitMQ server address. If no port is specified, 5672 is used.
NAME The desired name of the new queue.
TYPE The queue type. Has to be one of classic and quorum.

Flags:

Flag Short Description
--user -u The username to connect with. If not specified, you will be asked for it.
--password -p The password to authenticate with. If not specified, you will be asked for it.
--auto-delete Automatically delete the queue once there are no consumers left.
--durable Make the queue persistent, surviving server restarts.

Example:

Create a classic queue called my-queue on a RabbitMQ server running on the local machine.

$ buneary create queue localhost my-queue classic

Create a binding

Syntax:

$ buneary create binding 
[flags]

Arguments:

Argument Description
ADDRESS The RabbitMQ server address. If no port is specified, 5672 is used.
NAME The desired name of the new binding.
TARGET The name of the target queue or exchange. If it is an exchange, use --to-exchange.
BINDING KEY The binding key.

Flags:

Flag Short Description
--user -u The username to connect with. If not specified, you will be asked for it.
--password -p The password to authenticate with. If not specified, you will be asked for it.
--to-exchange Denote that the binding target is another exchange.

Example:

Create a binding from my-exchange to my-queue on a RabbitMQ server running on the local machine.

$ buneary create binding localhost my-exchange my-queue my-binding-key

Publish a message

Syntax:

$ buneary publish 
[flags]

Arguments:

Argument Description
ADDRESS The RabbitMQ server address. If no port is specified, 5672 is used.
EXCHANGE The name of the target exchange.
ROUTING KEY The routing key of the message.
BODY The actual message body.

Flags:

Flag Short Description
--user -u The username to connect with. If not specified, you will be asked for it.
--password -p The password to authenticate with. If not specified, you will be asked for it.

Example:

Publish a message Hello! to my-exchange on a RabbitMQ server running on the local machine. Note that message headers have not been implemented yet.

$ buneary publish localhost my-exchange my-routing-key "Hello!"

Delete an exchange

Syntax:

$ buneary delete exchange 
[flags]

Arguments:

Argument Description
ADDRESS The RabbitMQ server address. If no port is specified, 5672 is used.
NAME The name of the exchange to be deleted.

Flags:

Flag Short Description
--user -u The username to connect with. If not specified, you will be asked for it.
--password -p The password to authenticate with. If not specified, you will be asked for it.

Example:

Delete an exchange called my-exchange on a RabbitMQ server running on the local machine.

$ buneary delete exchange localhost my-exchange

Delete a queue

Syntax:

$ buneary delete queue 
[flags]

Arguments:

Argument Description
ADDRESS The RabbitMQ server address. If no port is specified, 5672 is used.
NAME The name of the queue to be deleted.

Flags:

Flag Short Description
--user -u The username to connect with. If not specified, you will be asked for it.
--password -p The password to authenticate with. If not specified, you will be asked for it.

Example:

Delete a queue called my-queue on a RabbitMQ server running on the local machine.

$ buneary delete queue localhost my-queue

Credits

Issues
  • `buneary create --help` displays probably wrong description for command `binding`

    `buneary create --help` displays probably wrong description for command `binding`

    Current:

    Available Commands:
      binding     Create a new queue <--
      exchange    Create a new exchange
      queue       Create a new queue
    

    Expected:

    Available Commands:
      binding     Create a new binding <--
      exchange    Create a new exchange
      queue       Create a new queue
    
    bug good first issue 
    opened by soupertonic 2
  • Fix constant requeue for get messages

    Fix constant requeue for get messages

    All messages requeue in spite of requeue flag because requeue field has been removed from Management UI and ackmode is ack_requeue_true.

    ackmode determines whether the messages will be removed from the queue. If ackmode is ack_requeue_true or reject_requeue_true they will be requeued - if ackmode is ack_requeue_false or reject_requeue_false they will be removed.

    opened by rantanevich 1
  • Implement headers for messages

    Implement headers for messages

    At the moment, buneary cannot publish messages with headers. Sending messages with headers should be enabled by implementing a --headers or --header option.

    There are two possibilities here:

    • Either let the user pass a list of key-value pairs to the flag: --headers="key1=val1,key2=val2"
    • Or let the user specify multiple flags: --header key1=val1 --header key2=val2

    @aligator PTAL

    enhancement 
    opened by dominikbraun 1
  • Add context to errors

    Add context to errors

    At the moment, any error produced by functions in the standard library or third-party packages are returned without context. Additional context should be added to provide more information about when the error occured using fmt.Errorf:

    if err != nil {
        return fmt.Errorf("failed to make coffee: %s", err.Error())
    }
    
    enhancement good first issue 
    opened by dominikbraun 0
  • Interactive mode doesn't quite work on macOS

    Interactive mode doesn't quite work on macOS

    buneary's interactive mode seems to have some flaws on macOS. To reproduce, run any command that requires you to provide RabbitMQ credentials:

    buneary get exchanges localhost
    ... will wait forever ...
    

    You won't be prompted for your credentials at all. Instead, nothing seems to happen.

    Tested on macOS 11.1.

    bug help wanted 
    opened by dominikbraun 0
  • Implement `get messages` and `get message` command

    Implement `get messages` and `get message` command

    There should be a command for reading messages from a given queue. The command syntax should look as follows:

    $ buneary get messages <QUEUE NAME>
    

    This command should return a list (or actually table) of messages. Also, there should be the buneary get message command for detailed message information:

    $ buneary get message [<QUEUE NAME>] <MESSAGE ID OR SOMETHING LIKE THAT>
    

    Not sure if the queue name is required from a technical perspective. This command should return the message body and headers.

    enhancement help wanted 
    opened by dominikbraun 0
  • Return error on invalid command syntaxes

    Return error on invalid command syntaxes

    At the moment, buneary checks if the number of given arguments matches the required number of arguments. However, there's an edge case where a command does exist, the number of arguments doesn't match and buneary won't complain (but neither will do anything).

    Correct:

    $ buneary create exchange localhost my-exchange direct
    

    Wrong:

    $ buneary create localhost exchange my-exchange direct
    

    There won't be an error in the second case - probably because the buneary create command exists but does not prescribe the number of arguments or require a subcommand (localhost is not a subcommand, but exchange is).

    bug good first issue 
    opened by dominikbraun 0
  • Display success message when resources have been created successfully

    Display success message when resources have been created successfully

    After running a command like buneary create exchange, there should be a success message indicating that the resource has been created.

    The output could look like this:

    $ buneary create exchange localhost my-exchange direct
    Successfully created exchange my-exchange.
    
    enhancement good first issue 
    opened by dominikbraun 0
  • Implement `buneary get` command for retrieving resource information

    Implement `buneary get` command for retrieving resource information

    As a buneary user, I want to be able to display resource information using the buneary get command. Since buneary strives to provide a kubectl-like interface, I'm planning to implement it as follows:

    • buneary get <ADDRESS> <RESOURCE TYPE> - e.g. buneary get localhost queues - returns a table containing all the items of the resources type.
    • buneary get <ADDRESS> <RESOURCE TYPE> <NAME> - e.g. buneary get localhost queue my-queue - returns information for a single item.

    Both command forms should return the same information per item. Note that the first form uses the plural and the second form uses the singular of the resource type (queues vs. queue). This is different from kubectl, but I consider it to be cleaner.

    The supported resource types will be queues, exchanges, bindings and maybe messages.

    For further information for a resource item, a command like buneary describe analogous to kubectl describe could make sense if needed.

    enhancement help wanted 
    opened by dominikbraun 0
  • Enable -v flag for buneary

    Enable -v flag for buneary

    At the moment, there's no -v flag for printing version information but only the version sub-command instead.

    The -v flag can be enabled by assigning the main.version variable to the Version field of the root command.

    enhancement good first issue 
    opened by dominikbraun 0
  • Create `lo` abbreviation for `localhost` in commands

    Create `lo` abbreviation for `localhost` in commands

    buneary commands can become quite long, partially because the host - which mostly corresponds to localhost for local development - has to be specified in each command:

    $ buneary create exchange localhost my-exchange topic
    

    Introducing a lo abbreviation could shorten this a bit.

    $ buneary create exchange lo my-exchange topic
    

    Internally, it would be sufficient to check whether the address is "lo" and change it to "localhost" if it is.

    enhancement good first issue 
    opened by dominikbraun 0
Releases(v0.3.1)
Owner
Dominik Braun
I'm a Backend Developer focused on Go, Kubernetes and CI/CD.
Dominik Braun
RabbitMQ Reconnection client

rmqconn RabbitMQ Reconnection for Golang Wrapper over amqp.Connection and amqp.Dial. Allowing to do a reconnection when the connection is broken befor

Babiv Sergey 19 May 26, 2022
An AMQP 0-9-1 Go client maintained by the RabbitMQ team. Originally by @streadway: `streadway/amqp`

Go RabbitMQ Client Library This is a Go AMQP 0.9.1 client maintained by the RabbitMQ core team. It was originally developed by Sean Treadway. Differen

RabbitMQ 451 Aug 4, 2022
Declare AMQP entities like queues, producers, and consumers in a declarative way. Can be used to work with RabbitMQ.

About This package provides an ability to encapsulate creation and configuration of RabbitMQ([AMQP])(https://www.amqp.org) entities like queues, excha

Alex 75 Aug 1, 2022
:incoming_envelope: A fast Message/Event Hub using publish/subscribe pattern with support for topics like* rabbitMQ exchanges for Go applications

Hub ?? A fast enough Event Hub for go applications using publish/subscribe with support patterns on topics like rabbitMQ exchanges. Table of Contents

Leandro Lugaresi 118 Aug 2, 2022
Abstraction layer for simple rabbitMQ connection, messaging and administration

Jazz Abstraction layer for quick and simple rabbitMQ connection, messaging and administration. Inspired by Jazz Jackrabbit and his eternal hatred towa

SOCIFI Ltd. 15 May 21, 2022
RabbitMQ wire tap and swiss army knife

rabtap - RabbitMQ wire tap Swiss army knife for RabbitMQ. Tap/Pub/Sub messages, create/delete/bind queues and exchanges, inspect broker. Contents Feat

null 216 Jul 13, 2022
A user friendly RabbitMQ library written in Golang.

TurboCookedRabbit A user friendly RabbitMQ library written in Golang to help use streadway/amqp. Based on my work found at CookedRabbit. Work Recently

Tristan (HouseCat) Hyams 102 Jul 18, 2022
🚀 Golang, Go Fiber, RabbitMQ, MongoDB, Docker, Kubernetes, GitHub Actions and Digital Ocean

Bookings Solução de cadastro de usuários e reservas. Tecnologias Utilizadas Golang MongoDB RabbitMQ Github Actions Docker Hub Docker Kubernetes Digita

Jailton Junior 7 Feb 18, 2022
Golang AMQP wrapper for RabbitMQ with better API

go-rabbitmq Golang AMQP wrapper for RabbitMQ with better API Table of Contents Background Features Usage Installation Connect to RabbitMQ Declare Queu

Hadi Hidayat Hammurabi 7 Jun 28, 2022
High level manegment for rabbitmq.

High level manegment for rabbitmq. Features Simple configuration bootstrap. Gracefully shutting down. Consume messages in parallel specifying a number

Diego 4 Jan 11, 2022
A high-level RabbitMQ driver for Golang.

grabbitmq A high-level RabbitMQ driver for Golang. Import in your project: go get github.com/shaswata56/grabbitmq Usage Demo: package main import (

Shaswata Das 17 Nov 7, 2021
Testing message queues with RabbitMQ

Rabbit-MessageQueue Just a repository of RabbitMQ simple usage for queueing messages. You can use this as a sender or a receiver. More information is

Jawady Muhammad Habib 2 Mar 10, 2022
A RabbitMQ connection pool write in pure go

A RabbitMQ connection pool write in pure go

LiangKai 3 Oct 8, 2021
App for test hypothesis about API for rabbitmq

REST API для работы с RabbitMQ Приложение для работы с брокером сообщений RabbitMQ через REST API. Основная мысль - что одиночные сообщения отправлять

Konstantin 0 Nov 12, 2021
golang amqp rabbitmq produce consume

Step 1: Container Run Container docker run -itp 9001:9001 --name go_temp -v /usr/local/project/temp/go_amqp/:/home/ -d golang:1.16.6 Enter Container

null 0 Nov 26, 2021
Go service for CRUD note, log tracking by RabbitMQ

Service for CRUD note, log tracking by RabbitMQ Architecture Three components: Service note CRUD, use a DB RabbitMQ for saving messages pushed from se

Võ Trung Nhân 0 Nov 29, 2021
Tool for collect statistics from AMQP (RabbitMQ) broker. Good for cloud native service calculation.

amqp-statisticator Tool for collect statistics around your AMQP broker. For example RabbitMQ expose a lot information trought the management API, but

Jan Seidl 0 Dec 13, 2021
Simple go app with RabbitMQ in docker-compose

Docker-compose stand with RabbitMQ and sender/reciever. About First app is a producer that sends messages (1 per second / while-true loop), the second

Dmitry Tolstoy 0 Jan 5, 2022
🐇 Easy to use socket lib for Golang

Hare Sockets ?? Hare is a user-friendly lib for sockets in Golang. You can send and listen to TCP connections with a few lines of code. Contents Insta

Leonardo Lima 48 Jul 2, 2022