Repository navigation
Conversation
added 5 commits
December 3, 2021 09:55
Adds support for a listener to opt into being its own async job, rather than using the generic Wisper job. This can help with observability and prioritisation, since you can give different listeners different priorities, and they can be distinguished in APM software with ActiveJob integrations such as Datadog.
Owner
|
thanks, how does this compare to #19 |
Author
|
For our needs, #19 is not appropriate as we not only want to have jobs go to different queues, we also want different event subscribers to show up differently in observability tools like Datadog APM. With our solution we can replace the default behaviour (top line in this screenshot) with clearly domain specific jobs (rest of the lines):
You might also argue its more flexible since it exposes ActiveJob's full API. E.g. you might use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

(Opening this PR up to start discussion, it contains some internals that I can remove should it actually get up-streamed. Its unclear to me if this repo is still maintained so am avoiding committing too much time to a perfect PR for now, happy to revisit!)
Background
We have built out a reasonably high throughput internal domain events system using Wisper. Due to the nature of some of our events, its not uncommon for us to see multi-minute queue backlogs when a burst of events are fired. As such, its quite a problem for us to have all these events going into the same queue and wrapped in a single job.
The single queue means we can't prioritise them (we use Sidekiq, with queues of different priorities)
The single job means we cannot easily tell them apart in Datadog APM, so when the Wisper queue is backlogged, identifying the cause is harder than we'd like. Answering questions like "how much time is Sidekiq spending processing all of event X" is much harder than it needs to be too.
Solution
Our solution has been to provide a system where an event listener can opt in to being its own async wrapper job. I can explain further if necessary but I have updated the docs and specs, so hope its fairly self explanatory.