My App has a single multipurpose Platform Event called MyEvent__e
which is emitted by MANY publishers and for MANY Topics.
Receivers and subscribers need to subscribe to the event type and then do filtering on the Publisher (a String) and a Topic (and URL-like String) to find out if they actually want to handle a specific event.
My naive train of thought was to just let different purpose-specific flows or Apex Event Triggers (Handlers) do that but then someone said: "No you need a centralized Router. Otherwise it's super inefficient".
I tried it out and actually build one. But it just add complexity and syntactic sugar, but for a given complex matching I never gets better than ExD (for each event asked each subscriber if its relevant for it).
So my questions are:
- Do I need central routing for Generic Platform Events?
- Why or why not?
- If you recommend it how does that handle 1001 Flows that bypass my central router?
- Are there published best-practices or even Open-Source Apex routers?