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

Document use of DSYNC_WEBHOOK_BATCH_SIZE #308

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)