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

Add cross-instance messenger pubsub setup #13651

Merged
merged 5 commits into from Jun 1, 2022
Merged

Conversation

rijkvanzanten
Copy link
Member

@rijkvanzanten rijkvanzanten commented May 31, 2022

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 to redis, 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

  • Bugfix
  • New Feature
  • Refactor / codestyle updates
  • Other, please describe:

Requirements Checklist

  • New / updated tests are included
  • All tests are passing locally
  • Performed a self-review of the submitted code

If adding a new feature:

  • Documentation was added/updated

Left to-do:

  • Docs

api/src/env.ts Outdated Show resolved Hide resolved
api/src/messenger.ts Outdated Show resolved Hide resolved
api/src/services/webhooks.ts Show resolved Hide resolved
api/src/webhooks.ts Show resolved Hide resolved
@rijkvanzanten rijkvanzanten marked this pull request as ready for review June 1, 2022 17:58
@rijkvanzanten rijkvanzanten merged commit f89d981 into main Jun 1, 2022
@rijkvanzanten rijkvanzanten deleted the feat/messenger branch June 1, 2022 18:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-instance setups don't flush webhook events properly
1 participant