A weenie function for attaching the Weenie-standard pubsub (RabbitMQ) to a Weenie app.
WARNING: EXPERIMENTAL. Messaging is an area that will typically benefit from stronger opinions, so this library may
end up being too opinionated for you or not opinionated enough. Feedback welcome at
https://github.com/wymp/weenie/issues.
NOTE: This is a two-stage function, rather than a typical Weenie function. The first stage requires you to specify
a retry algorithm (exponential, periodic or null), while the second stage is the actual weenie function. (This
assumes only two retry algorithms: exponential and periodic. I didn't want to bother with making this more dynamic
for now, but if more options are needed, you could always write a small wrapper around this that provides your
desired retry algorithm masquerading as one of the two options.)
You should be sure to pass the type paramters SubMsgType and PubMsgType to this function to ensure that messages
are typed correctly. Otherwise this doesn't add much value.
A weenie function for attaching the Weenie-standard pubsub (RabbitMQ) to a Weenie app.
WARNING: EXPERIMENTAL. Messaging is an area that will typically benefit from stronger opinions, so this library may end up being too opinionated for you or not opinionated enough. Feedback welcome at https://github.com/wymp/weenie/issues.
NOTE: This is a two-stage function, rather than a typical Weenie function. The first stage requires you to specify a retry algorithm (exponential, periodic or null), while the second stage is the actual weenie function. (This assumes only two retry algorithms: exponential and periodic. I didn't want to bother with making this more dynamic for now, but if more options are needed, you could always write a small wrapper around this that provides your desired retry algorithm masquerading as one of the two options.)
You should be sure to pass the type paramters
SubMsgType
andPubMsgType
to this function to ensure that messages are typed correctly. Otherwise this doesn't add much value.See https://npmjs.com/package/@wymp/simple-pubsub-amqp for a full example usage of this.