Skip to content

Commit

Permalink
Document use of DSYNC_WEBHOOK_BATCH_SIZE (#308)
Browse files Browse the repository at this point in the history
* Document use of DSYNC_WEBHOOK_BATCH_SIZE

* Update events processing endpoint in API reference
  • Loading branch information
Kiran K authored Nov 27, 2023
1 parent ad7e9af commit 61df1bf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
18 changes: 18 additions & 0 deletions docs/directory-sync/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,3 +646,21 @@ const { data, status } = await directorySyncController.requests.handle(
callback
);
```

### Batch processing events

You can enable batch processing of directory sync events instead of receiving events in real-time on your webhook endpoint. Once enabled, Jackson will queue the events and process them in batches. The batch size can be configured using the [DSYNC_WEBHOOK_BATCH_SIZE](/docs/jackson/deploy/env-variables#dsync_webhook_batch_size) environment variable.

You'll ideally want to run the events processing endpoint on a schedule. You can use a cron job to do this.

<Tabs>
<TabItem value="02" label="Shell">

```bash
curl -X POST \
-H "Authorization: Api-Key YOUR_API_KEY" \
http://localhost:5225/api/v1/dsync/cron/process-events
```

</TabItem>
</Tabs>
10 changes: 9 additions & 1 deletion docs/jackson/deploy/env-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The env vars are only applicable to the Jackson service. If you are using the np

### **HOSTNAME**

If you need to bind to a specific hostname, you can define `HOSTNAME` environment variable.
If you need to bind to a specific hostname, you can define `HOSTNAME` environment variable.
For example, if you are planning to use a Docker health check like `wget -q --spider http://localhost:{PORT}/api/health || exit 1` set `HOSTNAME=0.0.0.0` to listen to localhost.

### **HOST_URL**
Expand Down Expand Up @@ -388,3 +388,11 @@ you need to set the admin root token for Retraced so that we can connect to Retr
### **BOXYHQ_NO_TELEMETRY** or **DO_NOT_TRACK**

Set one of these to `1` or `true` to turn off our anonymous analytics. We only track usage events once per day and it does not contain any information that can identify you in any form.

## Directory Sync

The following env vars are used to configure the directory sync feature.

### **DSYNC_WEBHOOK_BATCH_SIZE**

Enable batch processing of directory sync events. The value represents the number of events to batch together instead of sending each event individually. This requires you to configure a cron job to [process the queued events](/docs/directory-sync/api-reference#batch-processing-events)

0 comments on commit 61df1bf

Please sign in to comment.