-
Notifications
You must be signed in to change notification settings - Fork 132
Description
I'm integration river into a project and would love to be able to have some kind of a middleware pattern whereby I can inject metadata such as trace IDs, correlation IDs, etc...
I'm looking for something akin to the ClientMiddleware available in Sidekiq, which allows for access to the job object before persistence. The equivalent for ServerMiddleware is more straightforward, as wrapping the Worker interface is easily done!
I think for the time being I'll create a smaller Client interface for river that I propagate through my application which I can then use to wrap the Insert operations with custom logic that have access to the context in a uniform manner.
It might be nice for that to be something that can be configured directly on a *river.Client as a middleware stack?
Would be great to hear thoughts about how others are approaching this problem, and views around this from the maintainers as well! Thank you 😄