Hassle-free RabbitMQ library which abstracts the complications of queue creation, subsciption, channel maintenance and connection management. Opens connections on demand with optimal use of channels with an internal connection pool, limit optionally configurable per channel
go get github.com/govindamurali/fluffle
fluffle.Start(rabbitMQConfig, logger)
sampleQueue:= fluffle.New("sample queue", prefetchCount)
err:= sampleQueue.Publish(someData)
err = sampleQueue.PublishIdempotent(idempotencyKey, idempotencyValue, someData)
for msg := range sampleQueue.Consume() {
err := json.Unmarshal(msg.Body, &customStruct)
// do your thing
}