https://github.com/jrobles/conejo
Golang lib for simple RabbitMQ Connecting, Consuming, and Publishing
https://github.com/jrobles/conejo
golang golang-lib rabbitmq
Last synced: 11 months ago
JSON representation
Golang lib for simple RabbitMQ Connecting, Consuming, and Publishing
- Host: GitHub
- URL: https://github.com/jrobles/conejo
- Owner: jrobles
- License: mit
- Created: 2016-03-31T03:09:26.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-07T19:47:38.000Z (almost 8 years ago)
- Last Synced: 2025-04-04T12:51:23.784Z (about 1 year ago)
- Topics: golang, golang-lib, rabbitmq
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Conejo [](https://goreportcard.com/report/github.com/josemrobles/conejo) [](https://godoc.org/github.com/josemrobles/conejo) [](https://sourcegraph.com/github.com/josemrobles/conejo?badge)
Golang lib for RabbitMQ Connecting, Consuming, and Publishing. Needs a great deal of refining, but it's quick & dirty and gets the job done for my current project. WIll definitely refactor in the near future.
## Status
Currently on hold. I use this lib for several personal projects so all should be working as intended.
## Goals
* [ ] Unit Tests
* [ ] main.go
* [ ] channel.go
* [ ] producer.go
* [ ] queue.go
* [ ] exchange.go
## Usage
### Sample Producer
```go
package main
import (
"github.com/josemrobles/conejo"
)
var (
rmq = conejo.Connect("amqp://guest:guest@localhost:5672")
workQueue = make(chan string)
queue = conejo.Queue{Name: "queue_name", Durable: false, Delete: false, Exclusive: false, NoWait: false}
exchange = conejo.Exchange{Name: "exchange_name", Type: "topic", Durable: true, AutoDeleted: false, Internal: false, NoWait: false}
)
func main() {
err := conejo.Publish(rmq, queue, exchange, "{'employees':[{'firstName':'John','lastName':'Doe'}]}")
if err != nil {
print("fubar")
}
}
```
### Sample Consumer
```go
package main
import (
"github.com/josemrobles/conejo"
)
var (
rmq = conejo.Connect("amqp://guest:guest@localhost:5672")
queue = conejo.Queue{Name: "queue_name", Durable: false, Delete: false, Exclusive: false, NoWait: false}
exchange = conejo.Exchange{Name: "exchange_name", Type: "topic", Durable: true, AutoDeleted: false, Internal: false, NoWait: false}
)
func main() {
err := conejo.Consume(rmq, queue, exchange, "consumer_tag", workQueue)
if err != nil {
print("ERROR: %q", err)
}
}
```