This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also fixes default behaviour when not specifying directory or file on publishing
- Loading branch information
1 parent
4f5faf3
commit 1a3b80a
Showing
6 changed files
with
93 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# exclude binary | ||
rio | ||
rabbitio | ||
|
||
# exclude dirs | ||
# exclude build and example files/dirs | ||
data/ | ||
build/ | ||
vendor/ | ||
message* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,94 @@ | ||
# Rabbit IO - Work in Progress | ||
This is a tool to support backup and restoring of RabbitMQ messages, currently work in progress and might not be functional | ||
# Rabbit IO | ||
This is a tool to support backup and restoring of RabbitMQ messages | ||
|
||
## Requirements | ||
## Installing | ||
|
||
You will need following to build `rabbitio` locally: | ||
#### Download binary | ||
Pick your archtype from [Releases](https://github.com/meltwater/rabbitio/releases) and download, in addition you'll need to set the binary to be executable. | ||
|
||
- [Golang](https://golang.org/dl/) | ||
- [dep](https://github.com/golang/dep) | ||
Example with `linux-amd64` and version `v0.5.1`: | ||
``` | ||
wget https://github.com/meltwater/rabbitio/releases/download/v0.5.1/rio-v0.5.1-linux-amd64 -O rabbitio | ||
chmod +755 rabbitio | ||
``` | ||
|
||
## Getting started | ||
#### Using `go get` | ||
``` | ||
go get -u github.com/meltwater/rabbitio | ||
``` | ||
|
||
If you plan to work on `rabbitio` you will need to: | ||
## How to use RabbitIO | ||
|
||
1. Create directories | ||
After installing rabbitio, you can quickly test out `rabbitio` by using [docker-compose](https://docs.docker.com/compose/install/) | ||
|
||
Included is a docker-compose file to set up local rabbitmq. | ||
``` | ||
mkdir -p $GOPATH/src/github.com/meltwater | ||
cd $GOPATH/src/github.com/meltwater | ||
docker-compose up -d | ||
``` | ||
Go to your now running [local rabbit](http://localhost:15672) and create example exchange: `rabbitio-exchange` and queue `rabbitio-queue`, | ||
then bind the queue to the exchange. | ||
|
||
#### Publish your first message | ||
``` | ||
echo "My first message" > message && tar cfz message.tgz message # creates message.tgz | ||
rabbitio in -e rabbitio -q rabbitio -f message.tgz | ||
``` | ||
This will publish your first message into `rabbitio-exchange` and you'll see your message in the queue `rabbitio-queue` | ||
|
||
#### Consume your first message | ||
``` | ||
$ mkdir data | ||
$ rabbitio out -e rabbitio-exchange -q rabbitio-queue -d data/ | ||
2018/03/15 15:37:35 RabbitMQ connected: amqp://guest:guest@localhost:5672/ | ||
2018/03/15 15:37:35 Bind to Exchange: "rabbitio-exchange" and Queue: "rabbitio-queue", Messaging waiting: 1 | ||
^C Interruption, saving last memory bits.. | ||
2018/03/15 15:37:45 Wrote 203 bytes to data/1_messages_1.tgz | ||
2018/03/15 15:37:45 tarball writer closing | ||
``` | ||
We interrupt when the queue is empty by directly using a combination of `CTRL + C` once. This will save the last bits and ack the message. | ||
|
||
|
||
## Detailed Usage | ||
``` | ||
$ rabbitio | ||
Rabbit IO will help backup and restore your messages in RabbitMQ | ||
Usage: | ||
rabbitio [command] | ||
Available Commands: | ||
help Help about any command | ||
in Publishes documents from tarballs into RabbitMQ exchange | ||
out Consumes data out from RabbitMQ and stores to tarballs | ||
version Prints the version of Rabbit IO | ||
Flags: | ||
-e, --exchange string Exchange to connect to | ||
-h, --help help for rabbitio | ||
-p, --prefetch int Prefetch for batches (default 100) | ||
-q, --queue string Queue to connect to | ||
-r, --routingkey string Routing Key, if specified will override tarball routing key configuration (default "#") | ||
-t, --tag string AMQP Client Tag (default "Rabbit IO Connector ") | ||
-u, --uri string AMQP URI, uri to for instance RabbitMQ (default "amqp://guest:guest@localhost:5672/") | ||
Use "rabbitio [command] --help" for more information about a command. | ||
2. Clone `rabbitio`: | ||
``` | ||
|
||
|
||
## Contributing | ||
|
||
If you plan to work on `rabbitio` you will need [Golang](https://golang.org/dl/). PRs are welcome as well as implementation discussions. | ||
|
||
**Clone `rabbitio`** | ||
``` | ||
mkdir -p $GOPATH/src/github.com/meltwater | ||
cd $GOPATH/src/github.com/meltwater | ||
git clone [email protected]:meltwater/rabbitio.git | ||
``` | ||
|
||
3. Make: | ||
#### Building | ||
``` | ||
cd rabbitio | ||
make && make build | ||
|
@@ -35,6 +100,7 @@ For any bug reports or change requests, please create a Github issue or submit a | |
|
||
Also feel free to drop a line to the maintainers: | ||
|
||
- Joel ([@vorce](https://github.com/vorce), [[email protected]](mailto:[email protected])) | ||
- Stian ([@stiangrindvoll](https://github.com/stiangrindvoll), [[email protected]](mailto:[email protected])) | ||
- Joel ([@vorce](https://github.com/vorce)) | ||
- Stian ([@stiangrindvoll](https://github.com/stiangrindvoll)) | ||
- Team Blacksmiths ([[email protected]](mailto:[email protected])) | ||
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters