An easy-to-use CLI client for RabbitMQ.

Related tags

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 shad0wcore 2
  • Add context to errors

    Add context to errors

    Fixes #17.

    opened by dominikbraun 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
  • 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
  • Fix short description for create binding command

    Fix short description for create binding command

    Fixes #2.

    opened by dominikbraun 0
  • Enable -v flag for buneary

    Enable -v flag for buneary

    Fixes #3.

    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
  • Implement --headers option for message headers

    Implement --headers option for message headers

    Fixes #4.

    opened by dominikbraun 0
  • Implement `buneary get` commands

    Implement `buneary get` commands

    Fixes #7.

    This PR also introduces rabbit-hole as RabbitMQ HTTP API client, which will supersede streadway/amqp for operations like CreateExchange.

    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
  • 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.0)
Owner
Dominik Braun
I'm a Backend Developer focused on Go, Kubernetes and CI/CD.
Dominik Braun
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 6 Jul 17, 2021
A wrapper of streadway/amqp that provides reconnection logic and sane defaults

go-rabbitmq Wrapper of streadway/amqp that provides reconnection logic and sane defaults. Hit the project with a star if you find it useful ⭐ Supporte

Lane Wagner 72 Jul 23, 2021
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 49 Jul 24, 2021
An easy-to-use CLI client for RabbitMQ.

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

Dominik Braun 46 Jul 4, 2021
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 80 Jul 21, 2021
Machinery is an asynchronous task queue/job queue based on distributed message passing.

Machinery Machinery is an asynchronous task queue/job queue based on distributed message passing. V2 Experiment First Steps Configuration Lock Broker

Richard Knop 5.4k Jul 15, 2021
🚀 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 Jul 14, 2021
websocket based messaging server written in golang

Guble Messaging Server Guble is a simple user-facing messaging and data replication server written in Go. Overview Guble is in an early state (release

Sebastian Mancke 148 Jun 3, 2021
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. 12 May 31, 2021
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 67 Jul 20, 2021
A tiny wrapper over amqp exchanges and queues 🚌 ✨

Rabbus ?? ✨ A tiny wrapper over amqp exchanges and queues. In memory retries with exponential backoff for sending messages. Protect producer calls wit

Rafael Jesus 89 Jun 18, 2021
Declarative streaming ETL for mundane tasks, written in Go

Benthos is a high performance and resilient stream processor, able to connect various sources and sinks in a range of brokering patterns and perform h

Ashley Jeffs 3.2k Jul 27, 2021
Go client library SDK for Ably realtime messaging service

Ably Go A Go client library for www.ably.io, the realtime messaging service. Installation ~ $ go get -u github.com/ably/ably-go/ably Feature support T

Ably Realtime - our client library SDKs and libraries 33 Jul 15, 2021
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 15 Jun 21, 2021