Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small improvements to events package for nats publishing/subscription (…
…#87) - Adds small helps for setting up your subscriber/publisher configs with NATS - Adds missing definitions for event message event types - Adjusts PublishEventMessage to publish to similar subject name as we expect with PublishChangeMessage - Adjusts NATS to use `DurableCalculator` instead of `QueuePrefix` per NATS/watermill recommendations - This will now use a small function to calculate the name of the consumer instead of just using the queue/topic name. This was causing issues with overlapping consumer names for multiple instances/apps that were listening on the same subject. This now essentially will take the queue name that is provided by the application (`--event-subscriber-queuegroup`) and then concatenates it with a hex encoded string of the full topic name (prefix+calculated topic) to give us a consumer name that is easy to calculate. * Using the DurablePrefix gives us the added benefit of when a member of the queue group drops or rejoins, it will be able to pick back up where the last consume left off vs potentially starting fresh if all members of that group had previously dropped. --------- Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com> Signed-off-by: Tyler Auerbeck <tauerbeck@equinix.com> Co-authored-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com> Co-authored-by: Matt Siwiec <rizzza@users.noreply.github.com>
- Loading branch information