Skip to main content
Version: 0.16

rabbitwrap

A production-ready RabbitMQ client wrapper for Go with automatic reconnection, publisher confirms, consumer middleware, and a fluent API.

rabbitwrap sits on top of amqp091-go and owns everything a service running against RabbitMQ in production needs and would otherwise have to build itself: reconnection with backoff, topology that survives both a dropped connection and a channel-level exception, dead lettering, and broker-level retry.

go get github.com/KARTIKrocks/rabbitwrap

What you get

Auto-reconnectionExponential backoff for connections, publishers, and consumers, with a distinct callback for a permanent give-up
Declarative topologyExchanges, queues, and bindings restored after reconnects, and re-applied on a timer so a deleted binding cannot silently strand a consumer
Channel recoveryA channel-level exception (not just a dropped connection) is caught and the channel re-established
Publisher confirmsCorrelated by delivery tag; a single confirmed publisher is safe to share across goroutines
Consumer middlewareLogging, panic recovery, in-process retry, and broker-level backoff retry — or bring your own
Dead-letter queuesOne call wires the dead-letter exchange, queue, and binding for a work queue
Concurrent consumersConfigurable worker goroutines with graceful, bounded shutdown
Health checksconn.IsHealthy() for readiness probes
Thread safeConnections and publishers safe for concurrent use

Where to go next

  • Getting Started — install and connect
  • Connection — reconnection, backoff, and the two disconnect callbacks
  • Topology — declarative topology and why it survives what an imperative DeclareQueue/BindQueue does not
  • API Reference — full generated godoc on pkg.go.dev

Documentation layout

These guides explain concepts, patterns, and configuration. For exact type signatures, method sets, and struct fields, use pkg.go.dev — it is generated from the source and is always authoritative.

Requirements

Go 1.22 or later.