GenStage as an abstraction for RabbitMQ

Hello!

I’m experimenting with GenStage as an abstraction to consume/publish data from/to RabbitMQ.

An initial working version here ( GitHub - pma/wabbit: GenStage based interface for RabbitMQ ) and any suggestions to improve the API would be appreciated.

The documentation is still lacking but the example included will hopefully be enough to get started.

The progress so far includes:

  • GenStage based generic module to expose a RabbitMQ publisher as a GenStage consumer.
  • GenStage based generic module to expose a RabbitMQ consumer as a GenStage producer.
  • Automatic reconnects
  • Async publish/confirms with a configurable window
  • In-memory queue to store messages between reconnects
  • Auto retry publishing any unconfirmed/queued messages on reconnect
  • Callback for payload encoding/decoding and to override default publish options, per message
  • Callback after (re)opening a channel to setup exchanges, queues, bindings

Thank you,

Paulo

7 Likes

This is very exciting. Currently I’m planning to use Wabit in production? Is it safe to do so?

It’s safe in the sense that it’s provided free of charge, with no restrictions on how it’s used and without warranty of any kind :slight_smile:

But that said, I’m currently replacing the amqp lib for this one in some less critical parts of a production system.