Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Sticky" Message Handler configuration to a specific endpoint #801

Closed
jeremydmiller opened this issue Apr 4, 2024 · 6 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@jeremydmiller
Copy link
Member

This comes up often enough it's time to do something about it.

Let's say that there's a use case for the exact same message & message type to be handled separately and in parallel with separate message handlers. Wolverine can't do that today because it combines the handler calls on one chain ( a vestigal tail feature left over from the FubuTransportation roots)

Build some kind of syntax that allows for the handlers to be split between different endpoints & separate routing

@jeremydmiller jeremydmiller added the enhancement New feature or request label Apr 4, 2024
@BrianVallelunga
Copy link

I'll add in our use case for reference. We have an Azure Service Bus Topic with multiple subscriptions. All messages sent to the topic are of the same type. However, each subscription on the topic has a filter on it and we want individual handlers for each subscription. Currently, all of our handlers are called, regardless of which subscription the message arrives from.

@jeremydmiller
Copy link
Member Author

@BrianVallelunga I think this is likely to slide to Wolverine 2.3, but I'm hoping to get that out this coming week anyway. And thanks for the input!

@jeremydmiller
Copy link
Member Author

@BrianVallelunga Unsurprisingly, I think I need to punt this until 2.4 in the next couple weeks. I've done some preliminary work and investigation so far.

@jeremydmiller jeremydmiller added this to the 3.0 milestone Jun 18, 2024
@jeremydmiller
Copy link
Member Author

Notes

  • Create a one to many relationship between HandlerChain & Endpoint
  • HandlerGraph should stop using the ImHashMap of message type to HandlerChain and message type to IMessageHandler
  • Utilize the handler type & method name as part of the generated type name suffix for HandlerChain w/ sticky endpoint
  • [StickyHandler("endpoint name")]
  • HandlerGraph.Compile() needs to account for sticky endpoint to handler relationships
  • HandlerGraph.HandlerFor() methods need to assert there's only one per message type, and have an overload that takes in Endpoint
  • Add Endpoint argument to IExecutorFactory

@jeremydmiller
Copy link
Member Author

@BrianVallelunga Here's the first tranche of work: https://github.com/JasperFx/wolverine/tree/sticky-handlers

More to come, but this will make it into 3.0

@BrianVallelunga
Copy link

Thanks for the update. I'm looking forward to trying this when 3.0 is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants