LucaWolf / grabbit

Go wrapper for RabbitMQ client with managed connections, channels and topologies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grabbit

Golang wrapper for RabbitMQ managed connections.

Version 1.0.0 and beyond 🚀.
Note: API breaking from the previous β release (see CallbackProcessMessages)

Go Reference

Rationale

This is an alternative library providing auto-reconnection support. It's been heavily inspired by other projects (listed in credits) and my previous experiments. The reason for a new project (instead of cloning/contributing to an existing one) is that internals may start to diverge too much from the original and risk non-adoption.

Usage

Please use the wiki page for a detailed list of how to get the most out of this library.

Goals

What I'd like this library to provide is:

  • make use of the latest amqp091-go library; this is the up to date version building on streadway's original work
  • be able to share a connection between multiple channels
  • have connection and channels auto-recover (on infrastructure failure) via managers
  • replace the internal logging with an alternative. Current thought is to have some buffered channel over which detailed events are submitted (non-blocking)
  • have the topology defined by consumers and publishers. Once when creating and then during channels recovery (ephemeral queues/exchanges only)
  • provide an optional callback to the caller space during recoveries. This supplements in a synchronous (blocking) mode the logging replacement mechanism.
  • awaiting confirmation of the published events to be handled within the library. (perhaps allow an user defined function if needed). :recycle: I may abandon this in favor of application space handling :recycle:
  • consumers to accept user defined handlers for processing the received messages
  • the consumer handlers to also allow batch processing (with support for partial fulfillment of QoS expectations based on a timeout)
  • Bonus: optionally provide the users with access to the low level amqp.Channel. Unsafe initially. Note: safety migh have come for free if using the slightly higher level grabbit.Channel wrappers.

Non goals

  • not interested in concurrency safety of the channels. Publisher and consumers are relatively cheap, use plenty as needed instead of passing them across coroutines.

Credits

  • wagslane from whom I got heavily inspired to do the sane parameters, topology maintenance and consumer handlers. Please browse and star his repository.
  • Emir Ribic for his inspiring post that lead me to think about adding a resilience layer for the RabbitMQ client. You may want to read the full post
  • gbeletti from whose project I might pinch a few ideas. Regardless of drawing inspiration or not, his version made for an interesting reading.

About

Go wrapper for RabbitMQ client with managed connections, channels and topologies

License:MIT License


Languages

Language:Go 100.0%