From cb86d5180fa17cdc2ddcdef410bf9269fbf17393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20B=C3=BChner?= Date: Wed, 2 Oct 2024 17:19:25 +0200 Subject: [PATCH] docs: add diagram for event bus understanding --- docs/develop/event-bus/index.md | 15 +++++++++++++++ docs/img/gs_cloud_eventbus_diagram.svg | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 docs/develop/event-bus/index.md create mode 100644 docs/img/gs_cloud_eventbus_diagram.svg diff --git a/docs/develop/event-bus/index.md b/docs/develop/event-bus/index.md new file mode 100644 index 000000000..29ebafad9 --- /dev/null +++ b/docs/develop/event-bus/index.md @@ -0,0 +1,15 @@ +# Understanding the event bus data flow + +For general information about the event bus, hava a look [here](../../../src/catalog/event-bus/README.md). + +The following diagram demonstrates the data flow on the event bus: + +![Event Bus Data flow](../../img/gs_cloud_eventbus_diagram.svg) + +1. Changes on the catalog/config level are usually done via the REST interface or the WebUI (via the Gateway) +2. Changes are persisted in the catalog/config +3. The `CatalogApplicationEventPublisher` listens to the events of the (native) GeoServer/Catalog (triggered by step 2) +4. Whenever such an event fires, the `CatalogApplicationEventPublisher` will publish a "local" `GeoServerEvent`. Have a look [here](../../../src/catalog/events/README.md) for the full type hierarchy. +5. The `RemoteGeoServerEventBridge` (listens to these `GeoServerEvent`s and) broadcasts `RemoteGeoServerEvent`s to the event bus. +6. All registered microservices listen for incoming `RemoteGeoServerEvent`s +7. The payload of these remote events will be published as local events to reload/refresh the catalog/config locally. diff --git a/docs/img/gs_cloud_eventbus_diagram.svg b/docs/img/gs_cloud_eventbus_diagram.svg new file mode 100644 index 000000000..f10f1cb40 --- /dev/null +++ b/docs/img/gs_cloud_eventbus_diagram.svg @@ -0,0 +1,4 @@ + + + +
GeoServer Catalog/Config
2. update catalog/config
Gateway
Micoservice 1 (REST or WebUI)
RemoteGeoServerEventBridge
CatalogApplicationEventPublisher
4. publishes local (cloud) event
(remote = false)
1. change catalog/config
3. listens for (geoserver core) config events
Event Bus
(e.g. RabbitMQ)
5. Broadcasts RemoteGeoServerEvent
(with remote = true)
Micoservice 2 (WMS, WFS, etc)
7a. publish payload of
remote events as
local event to reload
catalog/config
RemoteGeoServerEventBridge
6a. Listens for incoming RemoteGeoServerEvent
(remote = true)
Micoservice n (WMS, WFS, etc)
7b. publish payload of
remote events as
local event to reload
catalog/config
RemoteGeoServerEventBridge
6b. Listens for incoming RemoteGeoServerEvent
(remote = true)
\ No newline at end of file