From 53c51be4b656b5d5ea9bd0c2b48322c1840d9bbe Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Wed, 22 Jan 2025 08:55:15 +0100 Subject: [PATCH] docs: decision record about multiple protocol webhooks (#4747) --- .../README.md | 39 +++++++++++++++++++ docs/developer/decision-records/README.md | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 docs/developer/decision-records/2025-01-21-multipe-protocol-webhooks/README.md diff --git a/docs/developer/decision-records/2025-01-21-multipe-protocol-webhooks/README.md b/docs/developer/decision-records/2025-01-21-multipe-protocol-webhooks/README.md new file mode 100644 index 0000000000..16a039570b --- /dev/null +++ b/docs/developer/decision-records/2025-01-21-multipe-protocol-webhooks/README.md @@ -0,0 +1,39 @@ +# Multiple Protocol Webhooks + +## Decision + +We will add capabilities of registering multiple `ProtocolWebhook` for driving the selection +of the `callbackAddress` based on the chosen protocol. + +## Rationale + +Currently, the `ProtocolWebhook` is a single injectable that is used to determine the `callbackAddress` +to use for a remote protocol request. This is a limitation in cases where multiple protocols or +multiple versions of the same protocol are supported. + +## Approach + +We will introduce a registry for `ProtocolWebhook`s: + +```java +public interface ProtocolWebhookRegistry { + + void registerWebhook(String protocol, ProtocolWebhook webhook); + + ProtocolWebhook resolve(String protocol); +} +``` + +where each protocol or each protocol version can register its own `ProtocolWebhook`. + +The `ProtocolWebhookRegistry` will be injected in replacement of the single `ProtocolWebhook` and +it will be resolved at runtime based on the user provided protocol. + +For the current DSP implementation we will register a `ProtocolWebhook` for each +DSP protocol version supported. + +### Changes to the Catalog + +Currently, the `ProtocolWebhook` is also used to configure the `endpointUrl` of the `DataService` +registered for the connector. Since we might have multiple `ProtocolWebhook` registered, we will +change the registration and resolution of `DataService`s based on the input protocol. \ No newline at end of file diff --git a/docs/developer/decision-records/README.md b/docs/developer/decision-records/README.md index bf702e9a92..80c032885f 100644 --- a/docs/developer/decision-records/README.md +++ b/docs/developer/decision-records/README.md @@ -68,4 +68,4 @@ - [2024-10-24 bidirectional-data-transfers](./2024-10-24-bidirectional-data-transfers) - [2024-11-06 configuration-injection](./2024-11-06-configuration-injection) - [2024-11-19 transformer-version-scheme](./2024-11-19-transformer-version-scheme) - +- [2025-01-21 Multiple Protocol Webhooks](./2025-01-21-multipe-protocol-webhooks)