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