-
Notifications
You must be signed in to change notification settings - Fork 1
Dispatcher
Dispatcher is a microservice responsible for handling webhooks from Kentico Kontent. It is an Azure function written in Typescript.
Dispatcher serves as a single endpoint of the Documentation portal backend from the view of Kentico Kontent - it filters and distributes webhook messages to the appropriate services. It does that by publishing events to an Azure Event Grid topic.
The service is accessible by its Azure function endpoint. In order to validate the request, the user has to specify a query parameter - source. Additionally, the service requires that the body of the request has the form of Kentico Kontent webhook.
The service has a single HTTP trigger that accepts both GET
and POST
requests.
- test - optional, see Configuration for integration tests
After receiving a webhook from Kentico Kontent, the service does the following:
- Validates the source parameter of the request's query.
- Validates the request body.
- In some cases, a single change of published content fires 2 webhooks: One for the content item and the second one for the specific content item variant. The service does not want to process 2 webhooks describing the same change, so it filters away webhooks for content items, with one exception - upsert operation on a content item.
- Finally, the service then composes the event according to the event schema and populates it with data from the received webhook.
{
"data": {
"test": string, (used for testing configuration)
"webhook": JSON (data from KC webhook)
},
"dataVersion": string,
"eventTime": string,
"eventType": string (source - query parameter),
"id": string (GUID),
"subject": string (operation specified in KC webhook)
}
{
"data": {
"test": "disabled",
"webhook": {
"items": [
{
"language": "default",
"codename": "article_codename",
"type": "article"
}
],
"taxonomies": []
}
},
"dataVersion": "1.0",
"eventTime": "2019-06-07T10:33:19.052Z",
"eventType": "kentico-kontent",
"id": "12345678-04f1-415d-af1e-723e936205ac",
"subject": "publish"
}
In order to support the integration tests, the Dispatcher offers a possibility to run all of its subscribed services in a testing configuration (a different set of environment variables). An additional test=enabled
query parameter will get propagated to the output message.
- Overview
- Website
- Dispatcher
- Notifier
- Search Functionality
- GitHub Integration
- Bulk Publishing / Scheduling to Publish
- API Reference
- Integration Tests
- Content Models