Getting Started
Installation
Requires Go 1.22+.
go get github.com/KARTIKrocks/rabbitwrap
To pin an older release:
go get github.com/KARTIKrocks/rabbitwrap@v0.15.0
Quick Start
import rabbitmq "github.com/KARTIKrocks/rabbitwrap"
config := rabbitmq.DefaultConfig().
WithHost("localhost", 5672).
WithCredentials("guest", "guest").
WithLogger(rabbitmq.NewStdLogger())
conn, err := rabbitmq.NewConnection(config)
if err != nil {
log.Fatal(err)
}
defer conn.Close()
See examples/basic/main.go for a complete working example.
Next steps
- Connection — reconnection, backoff, TLS, and channel recovery
- Publishing — publish text, JSON, or a built message
- Consuming — consume with a handler, or pull deliveries manually
- Topology — declare exchanges, queues, and bindings that survive a reconnect