You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 own Broker and replacing the RailsEventStore::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 the RubyEventStore::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:
Either by having an empty subscriber of ->{} to fool Broker and make it route all published events through dispatcher. This has the advantage of dispatcher having access to both event object and serialized record, more suitable to pass over the network.
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 subscribe_to_all_events makes a lot of sense. I'm also now thinking that another way around this would be for us to run two event stores side-by-side: one which has a subscription to all events, persists them & forwards them to the external queue, and a second which has all of our "actual" subscribers, doesn't persist anything, and routes events from the external queue.
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: