Skip to content

Middleware and Consumer API Overhaul

Compare
Choose a tag to compare
@mxriverlynn mxriverlynn released this 28 Jan 22:56
· 63 commits to master since this release

MAJOR BREAKING CHANGES

This release marks a significant change in the internals of Rabbus, completely replacing the middleware implementation with a library called generic-middleware to provide a more Express.js like middleware experience.

Because of this change internally, the external API has also been updated for middleware on both producers and consumers. Additionally, consumer methods to receive messages now follow the same middleware format.

With this change, receiving a message through a Rabbus object will no longer automatically ack or nack a message for you. Now, you must call actions.ack() or .nack() or .reject() as is appropriate for your situation.

Lastly, error handling has been greatly improved. You can now register an error handler middleware function, similar to Express.js error handlers. This provides much more flexibility and the ability to nack or reject a message on error.

For more information, see the upgrade guide.