Add cross-instance messenger pubsub setup #13651
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a Messenger system to Directus, which allows for cross-instance communication. This is currently used to fix #13650, but can in the future also be used for WebSockets, syncing CRON jobs, and other load balanced operations.
Every instance is both a publisher and a subscriber, which allows any instance to trigger any change on other instances.
When
MESSENGER_STORE
isn't configured toredis
, it'll default to a no-op fallback (there's no need for a messenger setup like this if you're running Directus on a single instance)Fixes #13650
Request to instance w/ port 8055 triggers
RELOAD
on only 8056 and vice versa:CleanShot.2022-05-31.at.18.34.45.mp4
Type of Change
Requirements Checklist
If adding a new feature:
Left to-do: