Skip to content

Commit 1dd4ff4

Browse files
pulak-optijaeopt
andauthored
[FSSDK-9973] doc: update readme with webhook & notification synchronization doc (#413)
* update webhook doc * update doc * add line break * Update README.md Co-authored-by: Jae Kim <[email protected]> * Update README.md Co-authored-by: Jae Kim <[email protected]> * Update README.md Co-authored-by: Jae Kim <[email protected]> --------- Co-authored-by: Jae Kim <[email protected]>
1 parent e0c7586 commit 1dd4ff4

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,29 @@ To accept webhook requests Agent must be configured by mapping an Optimizely Pro
186186
with the associated secret used for validating the inbound request. An example webhook configuration can
187187
be found in the the provided [config.yaml](./config.yaml).
188188
189+
When running Agent in High Availability (HA) mode, it's important to ensure that all nodes are updated promptly when a webhook event (datafile updated) is received. By default, only one Agent node or instance will receive the webhook notification. A pub-sub system can be used to ensure this.
190+
191+
Redis, a powerful in-memory data structure store, can be used as a relay to propagate the datafile webhook event to all other nodes in the HA setup. This ensures that all nodes are notified about the event and can update their datafiles accordingly.
192+
193+
To set up Redis as a relay, you need to enable the datafile synchronization in your Optimizely Agent configuration. The PubSub feature of Redis is used to publish the webhook notifications to all subscribed Agent nodes.
194+
195+
Here's an example of how you can enable the datafile synchronization with Redis:
196+
197+
```yaml
198+
## synchronization should be enabled when features for multiple nodes like notification streaming are deployed
199+
synchronization:
200+
pubsub:
201+
redis:
202+
host: "localhost:6379"
203+
password: ""
204+
database: 0
205+
## if datafile synchronization is enabled, then for each webhook API call
206+
## the datafile will be sent to all available replicas to achieve better eventual consistency
207+
datafile:
208+
enable: true
209+
default: "redis"
210+
```
211+
189212
## Admin API
190213
191214
The Admin API provides system information about the running process. This can be used to check the availability
@@ -432,6 +455,24 @@ Optimizely Agent supports authorization workflows based on OAuth and JWT standar
432455

433456
Just as you can use Notification Listeners to subscribe to events of interest with Optimizely SDKs, you can use the Notifications endpoint to subscribe to events in Agent. For more information, see the [Notifications Guide](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/agent-notifications).
434457

458+
When the Agent is operating in High Availability (HA) mode, you need to enable notification synchronization to get notifications from all nodes in an HA setup. A PubSub system (Redis) is now used to ensure consistent retrieval of notification events across all nodes in an HA setup.
459+
Here's an example of how you can enable the notification synchronization with Redis:
460+
461+
```yaml
462+
## synchronization should be enabled when features for multiple nodes like notification streaming are deployed
463+
synchronization:
464+
pubsub:
465+
redis:
466+
host: "localhost:6379"
467+
password: ""
468+
database: 0
469+
## if notification synchronization is enabled, then the active notification event-stream API
470+
## will get the notifications from available replicas
471+
notification:
472+
enable: true
473+
default: "redis"
474+
```
475+
435476
## Agent Development
436477

437478
### Package Structure

0 commit comments

Comments
 (0)