-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: decision record about multiple protocol versions
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
docs/developer/decision-records/2024-09-25-multiple-protocol-versions/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Multiple protocol versions | ||
|
||
## Decision | ||
|
||
We will introduce a `protocolVersion` in `RemoteMessage`, `TransferProcess` and `ContractNegotiation` that will drive | ||
the selection the right protocol version for connector to connector communication. | ||
|
||
## Rationale | ||
|
||
Currently, EDC supports only [DSP](https://docs.internationaldataspaces.org/ids-knowledgebase/v/dataspace-protocol) | ||
in the current stable form. As the spec is evolving, we should prepare the EDC for supporting multiple versions in the | ||
same EDC runtime. This will enable the communication between two EDC connectors as long as they agree on a common | ||
supported version. | ||
|
||
## Approach | ||
|
||
A new method will be added in the `RemoteMessage`: | ||
|
||
```java | ||
public interface RemoteMessage { | ||
... | ||
|
||
/** | ||
* Returns the transport protocol version for this message. | ||
*/ | ||
String getProtocolVersion(); | ||
} | ||
``` | ||
|
||
The `protocolVersion` should be stored together like the `protocol` field in `ContractNegotiation` and `TransferProcess` | ||
entities. Once stored, it can be used for dispatching subsequent `RemoteMessage`s using the same version. | ||
|
||
In the context of [DSP](https://docs.internationaldataspaces.org/ids-knowledgebase/v/dataspace-protocol) implementation | ||
a protocol version consists of: | ||
|
||
- A set of Transformers for `RemoteMessage`s serialization/deserialization. | ||
- A scoped JSON-LD `@context` configured in the `JsonLd` service. | ||
- A set of Controllers for receiving protocol `RemoteMessage`s. | ||
|
||
### Transformers | ||
|
||
Instead of having a single `TypeTransformerRegistry` for the `dsp-api` context, we should have one for | ||
each [DSP](https://docs.internationaldataspaces.org/ids-knowledgebase/v/dataspace-protocol) supported version. | ||
|
||
### JSON-LD `@context` | ||
|
||
Currently, we bind [DSP](https://docs.internationaldataspaces.org/ids-knowledgebase/v/dataspace-protocol) specific | ||
namespaces/contexts definition under the scope `DSP`. We should have multiple configurations for each supported version | ||
|
||
### Controllers | ||
|
||
We already provide versioned controllers, but each version should have its own `JerseyJsonLdInterceptor` for injecting | ||
the right JSON-LD scope. This can be achieved using `jakarta.ws.rs.container.DynamicFeature` interface. | ||
|
||
The `protocolVersion` should be added also in `DspRequest` for selecting the right transformers for `RemoteMessage`s. | ||
|
||
## Further considerations | ||
|
||
How the `protocolVersion` is vehicle for the initial requests like `TransferRequest` or `ContractRequest` is not decided | ||
in this DR. | ||
|
||
We could: | ||
|
||
- automatically detect the common | ||
supported [version](https://docs.internationaldataspaces.org/ids-knowledgebase/v/dataspace-protocol/common-functionalities/common.protocol). | ||
- let the user input the `protocolVersion` in the management APIs. | ||
|
||
If no `protocolVersion` is specified or found, the behavior should guarantee backward compatibility. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters