-
Notifications
You must be signed in to change notification settings - Fork 125
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
Making the broker configurable #1649
Comments
Thank you for reporting this. I agree than current Broker implementation is a bit too tied to in-process event handling, which at the moment prevents dispatching without any subscriber. I believe this the main problem. Making Broker interchangeable is one thing, ensuring that passing dispatcher and subscriptions still makes sense is another. I'm not sure yet what is the best long-term solution. Happy to see your proposal. |
One workaround, until the issue is addressed, is to leverage subscribe_to_all_events. Either by having an empty subscriber of Or having the dispatch-to-external-queue there in all-events-subscriber. With the drawback of acting only on event objects as subscriptions do. |
Thank you so much for replying, and apologies for the long delay in getting back to you. I think your suggestion of using I think that'd work for us without requiring us to touch the broker at all, though I haven't actually had the time to try it out yet. |
Hi folks! I'm working on a project which is using
rails_event_store
for event persistence & publishing. However rather than sending & receiving events in-process, our dispatched events first make a round trip through an external queue (in order to, e.g., subscribe to events in other services).To do this we have to prevent the
RubyEventStore::Broker
from dispatching events directly to subscribers. We've achieved this currently by implementing our ownBroker
and replacing theRailsEventStore::Client
's@broker
instance variable, however this is naturally brittle as the broker interface is an internal detail of the library & its configuration is not officially supported.To resolve this, I was wondering if you would be open to making the
RailsEventStore::Client
's (and thus also theRubyEventStore::Client
's) broker configurable via the initializer? I appreciate this is a slightly niche use-case, so if that's not something you want to support I totally understand, but I figured it couldn't hurt to ask. 😁The text was updated successfully, but these errors were encountered: