From f198e71dc7ecfd3a9b109050ba500430acffbc75 Mon Sep 17 00:00:00 2001 From: Stiliyan Goranov Date: Wed, 3 Apr 2024 18:18:56 +0300 Subject: [PATCH 1/6] docs: annotate properly settings and refer to autodoc from the README files (#3986) * avoid outdatedness of the documentation of config params in README files --- .../control-plane/transfer/transfer-data-plane/README.md | 7 +------ extensions/data-plane/data-plane-control-api/README.md | 4 +--- extensions/data-plane/data-plane-http/README.md | 6 +----- .../connector/dataplane/http/DataPlaneHttpExtension.java | 8 +++++--- .../dataplane/kafka/DataPlaneKafkaExtension.java | 8 +++++--- extensions/data-plane/data-plane-public-api/README.md | 5 +++++ .../dataplane/api/DataPlanePublicApiExtension.java | 2 +- 7 files changed, 19 insertions(+), 21 deletions(-) create mode 100644 extensions/data-plane/data-plane-public-api/README.md diff --git a/extensions/control-plane/transfer/transfer-data-plane/README.md b/extensions/control-plane/transfer/transfer-data-plane/README.md index 98eb5d49ebe..db654876e9f 100644 --- a/extensions/control-plane/transfer/transfer-data-plane/README.md +++ b/extensions/control-plane/transfer/transfer-data-plane/README.md @@ -44,9 +44,4 @@ of its public API. OpenApi documentation can be found [here](../../../../resourc ### Configurations -| Parameter name | Description | Mandatory | Default value | -|:----------------------------------------------------|:-----------------------------------------------------------------------------------------------|:----------|:----------------------| -| `edc.transfer.proxy.token.validity.seconds` | Validity (in seconds) of tokens generated by the extension for accessing Data Plane public API | false | 600 | -| `edc.transfer.client.selector.strategy` | Strategy for Data Plane instance selection | false | random | -| `edc.transfer.proxy.token.signer.privatekey.alias` | Alias of private key used for signing tokens | false | Random EC public key | -| `edc.transfer.proxy.token.verifier.publickey.alias` | Alias of public key used for verifying the tokens | false | Random EC private key | +See [here](https://eclipse-edc.github.io/Connector/autodoc/#transfer-data-plane) the latest documentation for the available configuration parameters. diff --git a/extensions/data-plane/data-plane-control-api/README.md b/extensions/data-plane/data-plane-control-api/README.md index f9d3d659717..b288089da4a 100644 --- a/extensions/data-plane/data-plane-control-api/README.md +++ b/extensions/data-plane/data-plane-control-api/README.md @@ -50,9 +50,7 @@ _Provide some information about dependencies, e.g., used extensions._ ### Configurations -| Parameter name | Description | Mandatory | Default value | -|:----------------------------------------------------|:--------------------------------------------------------------------------------------------------|:----------|:---------------------------------------| -| `edc.dataplane.token.validation.endpoint` | Endpoint of the token validation server that will be hit when targeting the Data Plane public API | true | | +See [here](https://eclipse-edc.github.io/Connector/autodoc/#data-plane-control-api) the latest documentation for the available configuration parameters. ## Design Principles diff --git a/extensions/data-plane/data-plane-http/README.md b/extensions/data-plane/data-plane-http/README.md index b932ab6cc8a..1d2cd3f9477 100644 --- a/extensions/data-plane/data-plane-http/README.md +++ b/extensions/data-plane/data-plane-http/README.md @@ -23,11 +23,7 @@ Typically, this extension is used to fetch or post data from/to a REST endpoint. ### Configurations -The setting parameters of this extension are listed below: - -| Parameter name | Description | Mandatory | Default value | -|:-----------------------------------------|:---------------------------------------------------------------------|:----------|:--------------| -| `edc.dataplane.http.sink.partition.size` | Number of partitions for parallel message push in the `HttpDataSink` | false | 5 | +See [here](https://eclipse-edc.github.io/Connector/autodoc/#data-plane-http) the latest documentation for the available configuration parameters. ### Provided Services diff --git a/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java b/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java index 4e2833df8ec..2c1db6e838f 100644 --- a/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java +++ b/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java @@ -32,6 +32,8 @@ import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.edc.spi.types.TypeManager; +import static java.lang.Integer.parseInt; + /** * Provides support for reading data from an HTTP endpoint and sending data to an HTTP endpoint. */ @@ -39,9 +41,9 @@ @Extension(value = DataPlaneHttpExtension.NAME) public class DataPlaneHttpExtension implements ServiceExtension { public static final String NAME = "Data Plane HTTP"; - private static final int DEFAULT_PART_SIZE = 5; + private static final String DEFAULT_PARTITION_SIZE = "5"; - @Setting + @Setting(value = "Number of partitions for parallel message push in the HttpDataSink", defaultValue = DEFAULT_PARTITION_SIZE) private static final String EDC_DATAPLANE_HTTP_SINK_PARTITION_SIZE = "edc.dataplane.http.sink.partition.size"; @Inject @@ -67,7 +69,7 @@ public String name() { @Override public void initialize(ServiceExtensionContext context) { var monitor = context.getMonitor(); - var sinkPartitionSize = context.getSetting(EDC_DATAPLANE_HTTP_SINK_PARTITION_SIZE, DEFAULT_PART_SIZE); + var sinkPartitionSize = context.getSetting(EDC_DATAPLANE_HTTP_SINK_PARTITION_SIZE, parseInt(DEFAULT_PARTITION_SIZE)); var paramsProvider = new HttpRequestParamsProviderImpl(vault, typeManager); context.registerService(HttpRequestParamsProvider.class, paramsProvider); diff --git a/extensions/data-plane/data-plane-kafka/src/main/java/org/eclipse/edc/connector/dataplane/kafka/DataPlaneKafkaExtension.java b/extensions/data-plane/data-plane-kafka/src/main/java/org/eclipse/edc/connector/dataplane/kafka/DataPlaneKafkaExtension.java index 7dbf93b02ae..6e19d7f7722 100644 --- a/extensions/data-plane/data-plane-kafka/src/main/java/org/eclipse/edc/connector/dataplane/kafka/DataPlaneKafkaExtension.java +++ b/extensions/data-plane/data-plane-kafka/src/main/java/org/eclipse/edc/connector/dataplane/kafka/DataPlaneKafkaExtension.java @@ -27,14 +27,16 @@ import java.time.Clock; +import static java.lang.Integer.parseInt; + @Extension(value = DataPlaneKafkaExtension.NAME) public class DataPlaneKafkaExtension implements ServiceExtension { public static final String NAME = "Data Plane Kafka"; - private static final int DEFAULT_PARTITION_SIZE = 5; + private static final String DEFAULT_PARTITION_SIZE = "5"; - @Setting(value = "The partitionSize used by the kafka data sink", type = "int", defaultValue = "5", min = 1) + @Setting(value = "The partitionSize used by the kafka data sink", type = "int", defaultValue = DEFAULT_PARTITION_SIZE, min = 1) private static final String EDC_DATAPLANE_KAFKA_SINK_PARTITION_SIZE = "edc.dataplane.kafka.sink.partition.size"; @Inject @@ -56,7 +58,7 @@ public void initialize(ServiceExtensionContext context) { var monitor = context.getMonitor(); var propertiesFactory = new KafkaPropertiesFactory(); - var sinkPartitionSize = context.getSetting(EDC_DATAPLANE_KAFKA_SINK_PARTITION_SIZE, DEFAULT_PARTITION_SIZE); + var sinkPartitionSize = context.getSetting(EDC_DATAPLANE_KAFKA_SINK_PARTITION_SIZE, parseInt(DEFAULT_PARTITION_SIZE)); pipelineService.registerFactory(new KafkaDataSourceFactory(monitor, propertiesFactory, clock)); pipelineService.registerFactory(new KafkaDataSinkFactory(executorContainer.getExecutorService(), monitor, propertiesFactory, sinkPartitionSize)); diff --git a/extensions/data-plane/data-plane-public-api/README.md b/extensions/data-plane/data-plane-public-api/README.md new file mode 100644 index 00000000000..8511719389f --- /dev/null +++ b/extensions/data-plane/data-plane-public-api/README.md @@ -0,0 +1,5 @@ +# Data Plane Public API + +### Configurations + +See [here](https://eclipse-edc.github.io/Connector/autodoc/#data-plane-public-api) the latest documentation for the available configuration parameters. diff --git a/extensions/data-plane/data-plane-public-api/src/main/java/org/eclipse/edc/connector/dataplane/api/DataPlanePublicApiExtension.java b/extensions/data-plane/data-plane-public-api/src/main/java/org/eclipse/edc/connector/dataplane/api/DataPlanePublicApiExtension.java index f5c127ec158..a66efafc3f1 100644 --- a/extensions/data-plane/data-plane-public-api/src/main/java/org/eclipse/edc/connector/dataplane/api/DataPlanePublicApiExtension.java +++ b/extensions/data-plane/data-plane-public-api/src/main/java/org/eclipse/edc/connector/dataplane/api/DataPlanePublicApiExtension.java @@ -45,7 +45,7 @@ public class DataPlanePublicApiExtension implements ServiceExtension { private static final String PUBLIC_CONTEXT_ALIAS = "public"; private static final String PUBLIC_CONTEXT_PATH = "/api/v1/public"; - @Setting + @Setting(value = "Endpoint of the token validation server that will be hit when targeting the Data Plane public API", required = true) private static final String CONTROL_PLANE_VALIDATION_ENDPOINT = "edc.dataplane.token.validation.endpoint"; private static final int DEFAULT_THREAD_POOL = 10; From 0ac81aa880581341b22ddcad20da91a9c6658c98 Mon Sep 17 00:00:00 2001 From: Stiliyan Goranov <33035110+segoranov@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:58:20 +0300 Subject: [PATCH 2/6] docs: simplify description of setting Co-authored-by: Jim Marino --- .../connector/dataplane/api/DataPlanePublicApiExtension.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/data-plane/data-plane-public-api/src/main/java/org/eclipse/edc/connector/dataplane/api/DataPlanePublicApiExtension.java b/extensions/data-plane/data-plane-public-api/src/main/java/org/eclipse/edc/connector/dataplane/api/DataPlanePublicApiExtension.java index a66efafc3f1..e270998c2d9 100644 --- a/extensions/data-plane/data-plane-public-api/src/main/java/org/eclipse/edc/connector/dataplane/api/DataPlanePublicApiExtension.java +++ b/extensions/data-plane/data-plane-public-api/src/main/java/org/eclipse/edc/connector/dataplane/api/DataPlanePublicApiExtension.java @@ -45,7 +45,7 @@ public class DataPlanePublicApiExtension implements ServiceExtension { private static final String PUBLIC_CONTEXT_ALIAS = "public"; private static final String PUBLIC_CONTEXT_PATH = "/api/v1/public"; - @Setting(value = "Endpoint of the token validation server that will be hit when targeting the Data Plane public API", required = true) + @Setting(value = "Token validation server endpoint", required = true) private static final String CONTROL_PLANE_VALIDATION_ENDPOINT = "edc.dataplane.token.validation.endpoint"; private static final int DEFAULT_THREAD_POOL = 10; From 15bf9e3aa5fc95877f2ff7e3b742e8e72c7dd5c7 Mon Sep 17 00:00:00 2001 From: Stiliyan Goranov Date: Thu, 4 Apr 2024 12:14:14 +0300 Subject: [PATCH 3/6] fix: avoid string to int conversion in config parameters --- .../connector/dataplane/http/DataPlaneHttpExtension.java | 8 +++----- .../dataplane/kafka/DataPlaneKafkaExtension.java | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java b/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java index 2c1db6e838f..4a6af8d7d6e 100644 --- a/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java +++ b/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java @@ -32,8 +32,6 @@ import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.edc.spi.types.TypeManager; -import static java.lang.Integer.parseInt; - /** * Provides support for reading data from an HTTP endpoint and sending data to an HTTP endpoint. */ @@ -41,9 +39,9 @@ @Extension(value = DataPlaneHttpExtension.NAME) public class DataPlaneHttpExtension implements ServiceExtension { public static final String NAME = "Data Plane HTTP"; - private static final String DEFAULT_PARTITION_SIZE = "5"; + private static final int DEFAULT_PARTITION_SIZE = 5; - @Setting(value = "Number of partitions for parallel message push in the HttpDataSink", defaultValue = DEFAULT_PARTITION_SIZE) + @Setting(value = "Number of partitions for parallel message push in the HttpDataSink", defaultValue = DEFAULT_PARTITION_SIZE + "") private static final String EDC_DATAPLANE_HTTP_SINK_PARTITION_SIZE = "edc.dataplane.http.sink.partition.size"; @Inject @@ -69,7 +67,7 @@ public String name() { @Override public void initialize(ServiceExtensionContext context) { var monitor = context.getMonitor(); - var sinkPartitionSize = context.getSetting(EDC_DATAPLANE_HTTP_SINK_PARTITION_SIZE, parseInt(DEFAULT_PARTITION_SIZE)); + var sinkPartitionSize = context.getSetting(EDC_DATAPLANE_HTTP_SINK_PARTITION_SIZE, DEFAULT_PARTITION_SIZE); var paramsProvider = new HttpRequestParamsProviderImpl(vault, typeManager); context.registerService(HttpRequestParamsProvider.class, paramsProvider); diff --git a/extensions/data-plane/data-plane-kafka/src/main/java/org/eclipse/edc/connector/dataplane/kafka/DataPlaneKafkaExtension.java b/extensions/data-plane/data-plane-kafka/src/main/java/org/eclipse/edc/connector/dataplane/kafka/DataPlaneKafkaExtension.java index 6e19d7f7722..89d93eeb5bb 100644 --- a/extensions/data-plane/data-plane-kafka/src/main/java/org/eclipse/edc/connector/dataplane/kafka/DataPlaneKafkaExtension.java +++ b/extensions/data-plane/data-plane-kafka/src/main/java/org/eclipse/edc/connector/dataplane/kafka/DataPlaneKafkaExtension.java @@ -27,16 +27,14 @@ import java.time.Clock; -import static java.lang.Integer.parseInt; - @Extension(value = DataPlaneKafkaExtension.NAME) public class DataPlaneKafkaExtension implements ServiceExtension { public static final String NAME = "Data Plane Kafka"; - private static final String DEFAULT_PARTITION_SIZE = "5"; + private static final int DEFAULT_PARTITION_SIZE = 5; - @Setting(value = "The partitionSize used by the kafka data sink", type = "int", defaultValue = DEFAULT_PARTITION_SIZE, min = 1) + @Setting(value = "The partitionSize used by the kafka data sink", type = "int", defaultValue = DEFAULT_PARTITION_SIZE + "", min = 1) private static final String EDC_DATAPLANE_KAFKA_SINK_PARTITION_SIZE = "edc.dataplane.kafka.sink.partition.size"; @Inject @@ -58,7 +56,7 @@ public void initialize(ServiceExtensionContext context) { var monitor = context.getMonitor(); var propertiesFactory = new KafkaPropertiesFactory(); - var sinkPartitionSize = context.getSetting(EDC_DATAPLANE_KAFKA_SINK_PARTITION_SIZE, parseInt(DEFAULT_PARTITION_SIZE)); + var sinkPartitionSize = context.getSetting(EDC_DATAPLANE_KAFKA_SINK_PARTITION_SIZE, DEFAULT_PARTITION_SIZE); pipelineService.registerFactory(new KafkaDataSourceFactory(monitor, propertiesFactory, clock)); pipelineService.registerFactory(new KafkaDataSinkFactory(executorContainer.getExecutorService(), monitor, propertiesFactory, sinkPartitionSize)); From 50dcbf01ab72fff148271b8d3c4d0483fef7f454 Mon Sep 17 00:00:00 2001 From: Stiliyan Goranov Date: Thu, 4 Apr 2024 17:19:10 +0300 Subject: [PATCH 4/6] docs: annotate properly the settings and unify their usage --- core/common/connector-core/README.md | 13 +-- .../core/CoreDefaultServicesExtension.java | 95 ++++++++++--------- .../connector/core/CoreServicesExtension.java | 23 ++--- .../CoreServicesExtensionIntegrationTest.java | 4 +- .../http/DataPlaneHttpExtension.java | 2 +- 5 files changed, 64 insertions(+), 73 deletions(-) diff --git a/core/common/connector-core/README.md b/core/common/connector-core/README.md index 021009d53e4..78e8dc50b3f 100644 --- a/core/common/connector-core/README.md +++ b/core/common/connector-core/README.md @@ -4,15 +4,4 @@ Extension that registers default and core services as default implementations, h ## Configuration settings -| Parameter name | Description | Mandatory | Default value | -|------------------------------------------|----------------------------------------------------------------------|-----------|---------------| -| `edc.hostname` | Connector hostname, which e.g. is used in referer urls | false | localhost | -| `edc.http.enforce-https` | If true, enable HTTPS call enforcement. | false | false | -| `edc.core.retry.retries.max` | Maximum retries for the retry policy before a failure is propagated. | false | 5 | -| `edc.core.retry.backoff.min` | Minimum number of milliseconds for exponential backoff. | false | 500 | -| `edc.core.retry.backoff.max` | Maximum number of milliseconds for exponential backoff. | false | 10000 | -| `edc.core.retry.log.on.retry` | Log Failsafe onRetry events. | false | false | -| `edc.core.retry.log.on.retry.scheduled` | Log Failsafe onRetryScheduled events. | false | false | -| `edc.core.retry.log.on.retries.exceeded` | Log Failsafe onRetriesExceeded events. | false | false | -| `edc.core.retry.log.on.failed.attempt` | Log Failsafe onFailedAttempt events. | false | false | -| `edc.core.retry.log.on.abort` | Log Failsafe onAbort events. | false | false | +See [here](https://eclipse-edc.github.io/Connector/autodoc/#connector-core) the latest documentation for the available configuration parameters. diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreDefaultServicesExtension.java b/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreDefaultServicesExtension.java index be0158a6750..3d9ef773106 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreDefaultServicesExtension.java +++ b/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreDefaultServicesExtension.java @@ -39,8 +39,6 @@ import java.util.concurrent.Executors; -import static java.lang.Integer.parseInt; - /** * Provides default service implementations for fallback * Omitted {@link Extension} since this module contains the extension {@link CoreServicesExtension} @@ -49,39 +47,46 @@ public class CoreDefaultServicesExtension implements ServiceExtension { public static final String NAME = "Core Default Services"; - private static final String RETRY_POLICY_DEFAULT_RETRIES = "5"; - private static final String RETRY_POLICY_DEFAULT_MIN_BACKOFF = "500"; - private static final String RETRY_POLICY_DEFAULT_MAX_BACKOFF = "10000"; - private static final String RETRY_POLICY_DEFAULT_LOG = "false"; - @Setting(value = "RetryPolicy: Maximum retries before a failure is propagated", defaultValue = RETRY_POLICY_DEFAULT_RETRIES) + private static final int DEFAULT_RETRY_POLICY_MAX_RETRIES = 5; + private static final int DEFAULT_RETRY_POLICY_BACKOFF_MIN_MILLIS = 500; + private static final int DEFAULT_RETRY_POLICY_BACKOFF_MAX_MILLIS = 10000; + private static final boolean DEFAULT_RETRY_POLICY_LOG_ON_RETRY = false; + private static final boolean DEFAULT_RETRY_POLICY_LOG_ON_RETRY_SCHEDULED = false; + private static final boolean DEFAULT_RETRY_POLICY_LOG_ON_RETRIES_EXCEEDED = false; + private static final boolean DEFAULT_RETRY_POLICY_LOG_ON_FAILED_ATTEMPT = false; + private static final boolean DEFAULT_RETRY_POLICY_LOG_ON_ABORT = false; + private static final int DEFAULT_OK_HTTP_CLIENT_TIMEOUT_CONNECT = 30; + private static final int DEFAULT_OK_HTTP_CLIENT_TIMEOUT_READ = 30; + private static final boolean DEFAULT_OK_HTTP_CLIENT_HTTPS_ENFORCE = false; + private static final int DEFAULT_OK_HTTP_CLIENT_SEND_BUFFER_SIZE = 0; + private static final int DEFAULT_OK_HTTP_CLIENT_RECEIVE_BUFFER_SIZE = 0; + + @Setting(value = "RetryPolicy: Maximum retries before a failure is propagated", defaultValue = DEFAULT_RETRY_POLICY_MAX_RETRIES + "", type = "int") private static final String RETRY_POLICY_MAX_RETRIES = "edc.core.retry.retries.max"; - @Setting(value = "RetryPolicy: Minimum number of milliseconds for exponential backoff", defaultValue = RETRY_POLICY_DEFAULT_MIN_BACKOFF) + @Setting(value = "RetryPolicy: Minimum number of milliseconds for exponential backoff", defaultValue = DEFAULT_RETRY_POLICY_BACKOFF_MIN_MILLIS + "", type = "int") private static final String RETRY_POLICY_BACKOFF_MIN_MILLIS = "edc.core.retry.backoff.min"; - @Setting(value = "RetryPolicy: Maximum number of milliseconds for exponential backoff.", defaultValue = RETRY_POLICY_DEFAULT_MAX_BACKOFF) + @Setting(value = "RetryPolicy: Maximum number of milliseconds for exponential backoff", defaultValue = DEFAULT_RETRY_POLICY_BACKOFF_MAX_MILLIS + "", type = "int") private static final String RETRY_POLICY_BACKOFF_MAX_MILLIS = "edc.core.retry.backoff.max"; - @Setting(value = "RetryPolicy: Log onRetry events", defaultValue = RETRY_POLICY_DEFAULT_LOG) - static final String RETRY_POLICY_LOG_ON_RETRY = "edc.core.retry.log.on.retry"; - @Setting(value = "RetryPolicy: Log onRetryScheduled events", defaultValue = RETRY_POLICY_DEFAULT_LOG) - static final String RETRY_POLICY_LOG_ON_RETRY_SCHEDULED = "edc.core.retry.log.on.retry.scheduled"; - @Setting(value = "RetryPolicy: Log onRetriesExceeded events", defaultValue = RETRY_POLICY_DEFAULT_LOG) - static final String RETRY_POLICY_LOG_ON_RETRIES_EXCEEDED = "edc.core.retry.log.on.retries.exceeded"; - @Setting(value = "RetryPolicy: Log onFailedAttempt events", defaultValue = RETRY_POLICY_DEFAULT_LOG) - static final String RETRY_POLICY_LOG_ON_FAILED_ATTEMPT = "edc.core.retry.log.on.failed.attempt"; - @Setting(value = "RetryPolicy: Log onAbort events", defaultValue = RETRY_POLICY_DEFAULT_LOG) - static final String RETRY_POLICY_LOG_ON_ABORT = "edc.core.retry.log.on.abort"; - - private static final String OK_HTTP_CLIENT_DEFAULT_TIMEOUT = "30"; - private static final String OK_HTTP_CLIENT_DEFAULT_HTTPS_ENFORCE = "false"; - @Setting(value = "OkHttpClient: If true, enable HTTPS call enforcement.", defaultValue = OK_HTTP_CLIENT_DEFAULT_HTTPS_ENFORCE, type = "boolean") - public static final String OK_HTTP_CLIENT_HTTPS_ENFORCE = "edc.http.client.https.enforce"; - @Setting(value = "OkHttpClient: connect timeout, in seconds", defaultValue = OK_HTTP_CLIENT_DEFAULT_TIMEOUT, type = "int") - public static final String OK_HTTP_CLIENT_TIMEOUT_CONNECT = "edc.http.client.timeout.connect"; - @Setting(value = "OkHttpClient: read timeout, in seconds", defaultValue = OK_HTTP_CLIENT_DEFAULT_TIMEOUT, type = "int") - public static final String OK_HTTP_CLIENT_TIMEOUT_READ = "edc.http.client.timeout.read"; - @Setting(value = "OkHttpClient: send buffer size, in bytes", type = "int", min = 1) - public static final String OK_HTTP_CLIENT_SEND_BUFFER_SIZE = "edc.http.client.send.buffer.size"; - @Setting(value = "OkHttpClient: receive buffer size, in bytes", type = "int", min = 1) - public static final String OK_HTTP_CLIENT_RECEIVE_BUFFER_SIZE = "edc.http.client.receive.buffer.size"; + @Setting(value = "RetryPolicy: Log onRetry events", defaultValue = DEFAULT_RETRY_POLICY_LOG_ON_RETRY + "", type = "boolean") + private static final String RETRY_POLICY_LOG_ON_RETRY = "edc.core.retry.log.on.retry"; + @Setting(value = "RetryPolicy: Log onRetryScheduled events", defaultValue = DEFAULT_RETRY_POLICY_LOG_ON_RETRY_SCHEDULED + "", type = "boolean") + private static final String RETRY_POLICY_LOG_ON_RETRY_SCHEDULED = "edc.core.retry.log.on.retry.scheduled"; + @Setting(value = "RetryPolicy: Log onRetriesExceeded events", defaultValue = DEFAULT_RETRY_POLICY_LOG_ON_RETRIES_EXCEEDED + "", type = "boolean") + private static final String RETRY_POLICY_LOG_ON_RETRIES_EXCEEDED = "edc.core.retry.log.on.retries.exceeded"; + @Setting(value = "RetryPolicy: Log onFailedAttempt events", defaultValue = DEFAULT_RETRY_POLICY_LOG_ON_FAILED_ATTEMPT + "", type = "boolean") + private static final String RETRY_POLICY_LOG_ON_FAILED_ATTEMPT = "edc.core.retry.log.on.failed.attempt"; + @Setting(value = "RetryPolicy: Log onAbort events", defaultValue = DEFAULT_RETRY_POLICY_LOG_ON_ABORT + "", type = "boolean") + private static final String RETRY_POLICY_LOG_ON_ABORT = "edc.core.retry.log.on.abort"; + @Setting(value = "OkHttpClient: If true, enable HTTPS call enforcement", defaultValue = DEFAULT_OK_HTTP_CLIENT_HTTPS_ENFORCE + "", type = "boolean") + private static final String OK_HTTP_CLIENT_HTTPS_ENFORCE = "edc.http.client.https.enforce"; + @Setting(value = "OkHttpClient: connect timeout, in seconds", defaultValue = DEFAULT_OK_HTTP_CLIENT_TIMEOUT_CONNECT + "", type = "int") + private static final String OK_HTTP_CLIENT_TIMEOUT_CONNECT = "edc.http.client.timeout.connect"; + @Setting(value = "OkHttpClient: read timeout, in seconds", defaultValue = DEFAULT_OK_HTTP_CLIENT_TIMEOUT_READ + "", type = "int") + private static final String OK_HTTP_CLIENT_TIMEOUT_READ = "edc.http.client.timeout.read"; + @Setting(value = "OkHttpClient: send buffer size, in bytes", defaultValue = DEFAULT_OK_HTTP_CLIENT_SEND_BUFFER_SIZE + "", type = "int", min = 1) + private static final String OK_HTTP_CLIENT_SEND_BUFFER_SIZE = "edc.http.client.send.buffer.size"; + @Setting(value = "OkHttpClient: receive buffer size, in bytes", defaultValue = DEFAULT_OK_HTTP_CLIENT_RECEIVE_BUFFER_SIZE + "", type = "int", min = 1) + private static final String OK_HTTP_CLIENT_RECEIVE_BUFFER_SIZE = "edc.http.client.receive.buffer.size"; /** * An optional OkHttp {@link EventListener} that can be used to instrument OkHttp client for collecting metrics. @@ -123,11 +128,11 @@ public EdcHttpClient edcHttpClient(ServiceExtensionContext context) { @Provider public OkHttpClient okHttpClient(ServiceExtensionContext context) { var configuration = OkHttpClientConfiguration.Builder.newInstance() - .enforceHttps(context.getSetting(OK_HTTP_CLIENT_HTTPS_ENFORCE, Boolean.parseBoolean(OK_HTTP_CLIENT_DEFAULT_HTTPS_ENFORCE))) - .connectTimeout(context.getSetting(OK_HTTP_CLIENT_TIMEOUT_CONNECT, parseInt(OK_HTTP_CLIENT_DEFAULT_TIMEOUT))) - .readTimeout(context.getSetting(OK_HTTP_CLIENT_TIMEOUT_READ, parseInt(OK_HTTP_CLIENT_DEFAULT_TIMEOUT))) - .sendBufferSize(context.getSetting(OK_HTTP_CLIENT_SEND_BUFFER_SIZE, 0)) - .receiveBufferSize(context.getSetting(OK_HTTP_CLIENT_RECEIVE_BUFFER_SIZE, 0)) + .enforceHttps(context.getSetting(OK_HTTP_CLIENT_HTTPS_ENFORCE, DEFAULT_OK_HTTP_CLIENT_HTTPS_ENFORCE)) + .connectTimeout(context.getSetting(OK_HTTP_CLIENT_TIMEOUT_CONNECT, DEFAULT_OK_HTTP_CLIENT_TIMEOUT_CONNECT)) + .readTimeout(context.getSetting(OK_HTTP_CLIENT_TIMEOUT_READ, DEFAULT_OK_HTTP_CLIENT_TIMEOUT_READ)) + .sendBufferSize(context.getSetting(OK_HTTP_CLIENT_SEND_BUFFER_SIZE, DEFAULT_OK_HTTP_CLIENT_SEND_BUFFER_SIZE)) + .receiveBufferSize(context.getSetting(OK_HTTP_CLIENT_RECEIVE_BUFFER_SIZE, DEFAULT_OK_HTTP_CLIENT_RECEIVE_BUFFER_SIZE)) .build(); return OkHttpClientFactory.create(configuration, okHttpEventListener, context.getMonitor()); @@ -136,14 +141,14 @@ public OkHttpClient okHttpClient(ServiceExtensionContext context) { @Provider public RetryPolicy retryPolicy(ServiceExtensionContext context) { var configuration = RetryPolicyConfiguration.Builder.newInstance() - .maxRetries(context.getSetting(RETRY_POLICY_MAX_RETRIES, parseInt(RETRY_POLICY_DEFAULT_RETRIES))) - .minBackoff(context.getSetting(RETRY_POLICY_BACKOFF_MIN_MILLIS, parseInt(RETRY_POLICY_DEFAULT_MIN_BACKOFF))) - .maxBackoff(context.getSetting(RETRY_POLICY_BACKOFF_MAX_MILLIS, parseInt(RETRY_POLICY_DEFAULT_MAX_BACKOFF))) - .logOnRetry(context.getSetting(RETRY_POLICY_LOG_ON_RETRY, false)) - .logOnRetryScheduled(context.getSetting(RETRY_POLICY_LOG_ON_RETRY_SCHEDULED, false)) - .logOnRetriesExceeded(context.getSetting(RETRY_POLICY_LOG_ON_RETRIES_EXCEEDED, false)) - .logOnFailedAttempt(context.getSetting(RETRY_POLICY_LOG_ON_FAILED_ATTEMPT, false)) - .logOnAbort(context.getSetting(RETRY_POLICY_LOG_ON_ABORT, false)) + .maxRetries(context.getSetting(RETRY_POLICY_MAX_RETRIES, DEFAULT_RETRY_POLICY_MAX_RETRIES)) + .minBackoff(context.getSetting(RETRY_POLICY_BACKOFF_MIN_MILLIS, DEFAULT_RETRY_POLICY_BACKOFF_MIN_MILLIS)) + .maxBackoff(context.getSetting(RETRY_POLICY_BACKOFF_MAX_MILLIS, DEFAULT_RETRY_POLICY_BACKOFF_MAX_MILLIS)) + .logOnRetry(context.getSetting(RETRY_POLICY_LOG_ON_RETRY, DEFAULT_RETRY_POLICY_LOG_ON_RETRY)) + .logOnRetryScheduled(context.getSetting(RETRY_POLICY_LOG_ON_RETRY_SCHEDULED, DEFAULT_RETRY_POLICY_LOG_ON_RETRY_SCHEDULED)) + .logOnRetriesExceeded(context.getSetting(RETRY_POLICY_LOG_ON_RETRIES_EXCEEDED, DEFAULT_RETRY_POLICY_LOG_ON_RETRIES_EXCEEDED)) + .logOnFailedAttempt(context.getSetting(RETRY_POLICY_LOG_ON_FAILED_ATTEMPT, DEFAULT_RETRY_POLICY_LOG_ON_FAILED_ATTEMPT)) + .logOnAbort(context.getSetting(RETRY_POLICY_LOG_ON_ABORT, DEFAULT_RETRY_POLICY_LOG_ON_ABORT)) .build(); return RetryPolicyFactory.create(configuration, context.getMonitor()); diff --git a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreServicesExtension.java b/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreServicesExtension.java index aae1f682aed..0bb746c5643 100644 --- a/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreServicesExtension.java +++ b/core/common/connector-core/src/main/java/org/eclipse/edc/connector/core/CoreServicesExtension.java @@ -53,17 +53,14 @@ @Extension(value = CoreServicesExtension.NAME) public class CoreServicesExtension implements ServiceExtension { - @Setting - public static final String HOSTNAME_SETTING = "edc.hostname"; + public static final String NAME = "Core Services"; - /** - * The name of the claim key used to determine the participant identity. - */ - @Setting - public static final String IDENTITY_KEY = "edc.agent.identity.key"; + private static final String DEFAULT_EDC_HOSTNAME = "localhost"; - public static final String NAME = "Core Services"; - private static final String DEFAULT_HOSTNAME = "localhost"; + @Setting(value = "Connector hostname, which e.g. is used in referer urls", defaultValue = DEFAULT_EDC_HOSTNAME) + public static final String EDC_HOSTNAME = "edc.hostname"; + @Setting(value = "The name of the claim key used to determine the participant identity", defaultValue = DEFAULT_IDENTITY_CLAIM_KEY) + public static final String EDC_AGENT_IDENTITY_KEY = "edc.agent.identity.key"; @Inject private EventExecutorServiceContainer eventExecutorServiceContainer; @@ -103,9 +100,9 @@ public TypeManager typeManager() { @Provider public Hostname hostname(ServiceExtensionContext context) { - var hostname = context.getSetting(HOSTNAME_SETTING, DEFAULT_HOSTNAME); - if (DEFAULT_HOSTNAME.equals(hostname)) { - context.getMonitor().warning(String.format("Settings: No setting found for key '%s'. Using default value '%s'", HOSTNAME_SETTING, DEFAULT_HOSTNAME)); + var hostname = context.getSetting(EDC_HOSTNAME, DEFAULT_EDC_HOSTNAME); + if (DEFAULT_EDC_HOSTNAME.equals(hostname)) { + context.getMonitor().warning(String.format("Settings: No setting found for key '%s'. Using default value '%s'", EDC_HOSTNAME, DEFAULT_EDC_HOSTNAME)); } return () -> hostname; } @@ -122,7 +119,7 @@ public CommandHandlerRegistry commandHandlerRegistry() { @Provider public ParticipantAgentService participantAgentService(ServiceExtensionContext context) { - var identityKey = context.getSetting(IDENTITY_KEY, DEFAULT_IDENTITY_CLAIM_KEY); + var identityKey = context.getSetting(EDC_AGENT_IDENTITY_KEY, DEFAULT_IDENTITY_CLAIM_KEY); return new ParticipantAgentServiceImpl(identityKey); } diff --git a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/CoreServicesExtensionIntegrationTest.java b/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/CoreServicesExtensionIntegrationTest.java index 1cc3b319821..426cd31b856 100644 --- a/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/CoreServicesExtensionIntegrationTest.java +++ b/core/common/connector-core/src/test/java/org/eclipse/edc/connector/core/CoreServicesExtensionIntegrationTest.java @@ -23,14 +23,14 @@ import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.connector.core.CoreServicesExtension.HOSTNAME_SETTING; +import static org.eclipse.edc.connector.core.CoreServicesExtension.EDC_HOSTNAME; @ExtendWith(EdcExtension.class) class CoreServicesExtensionIntegrationTest { @BeforeEach void setUp(EdcExtension extension) { - extension.setConfiguration(Map.of(HOSTNAME_SETTING, "hostname")); + extension.setConfiguration(Map.of(EDC_HOSTNAME, "hostname")); } @Test diff --git a/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java b/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java index 4a6af8d7d6e..910bff9a77c 100644 --- a/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java +++ b/extensions/data-plane/data-plane-http/src/main/java/org/eclipse/edc/connector/dataplane/http/DataPlaneHttpExtension.java @@ -41,7 +41,7 @@ public class DataPlaneHttpExtension implements ServiceExtension { public static final String NAME = "Data Plane HTTP"; private static final int DEFAULT_PARTITION_SIZE = 5; - @Setting(value = "Number of partitions for parallel message push in the HttpDataSink", defaultValue = DEFAULT_PARTITION_SIZE + "") + @Setting(value = "Number of partitions for parallel message push in the HttpDataSink", type = "int", defaultValue = DEFAULT_PARTITION_SIZE + "") private static final String EDC_DATAPLANE_HTTP_SINK_PARTITION_SIZE = "edc.dataplane.http.sink.partition.size"; @Inject From b538d2174190b0d5d26dedb920ba7a26f16c1e78 Mon Sep 17 00:00:00 2001 From: Stiliyan Goranov Date: Fri, 5 Apr 2024 15:29:28 +0300 Subject: [PATCH 5/6] chore: update DEPENDENCIES file --- DEPENDENCIES | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index d66d78a7f3b..45be55a58d7 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -103,9 +103,9 @@ maven/mavencentral/commons-logging/commons-logging/1.2, Apache-2.0, approved, CQ maven/mavencentral/dev.failsafe/failsafe-okhttp/3.3.2, Apache-2.0, approved, #9178 maven/mavencentral/dev.failsafe/failsafe/3.3.2, Apache-2.0, approved, #9268 maven/mavencentral/info.picocli/picocli/4.7.5, Apache-2.0, approved, #4365 -maven/mavencentral/io.cloudevents/cloudevents-api/3.0.0, , restricted, clearlydefined -maven/mavencentral/io.cloudevents/cloudevents-core/3.0.0, , restricted, clearlydefined -maven/mavencentral/io.cloudevents/cloudevents-http-basic/3.0.0, , restricted, clearlydefined +maven/mavencentral/io.cloudevents/cloudevents-api/3.0.0, Apache-2.0, approved, #14228 +maven/mavencentral/io.cloudevents/cloudevents-core/3.0.0, Apache-2.0, approved, #14227 +maven/mavencentral/io.cloudevents/cloudevents-http-basic/3.0.0, Apache-2.0, approved, #14229 maven/mavencentral/io.github.classgraph/classgraph/4.8.154, MIT, approved, CQ22530 maven/mavencentral/io.micrometer/micrometer-commons/1.12.4, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #11679 maven/mavencentral/io.micrometer/micrometer-core/1.12.4, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #11678 @@ -348,7 +348,7 @@ maven/mavencentral/org.slf4j/slf4j-api/2.0.9, MIT, approved, #5915 maven/mavencentral/org.testcontainers/database-commons/1.19.7, Apache-2.0, approved, #10345 maven/mavencentral/org.testcontainers/jdbc/1.19.7, Apache-2.0, approved, #10348 maven/mavencentral/org.testcontainers/junit-jupiter/1.19.7, MIT, approved, #10344 -maven/mavencentral/org.testcontainers/kafka/1.19.7, None, restricted, #14177 +maven/mavencentral/org.testcontainers/kafka/1.19.7, MIT, approved, #14177 maven/mavencentral/org.testcontainers/postgresql/1.19.7, MIT, approved, #10350 maven/mavencentral/org.testcontainers/testcontainers/1.19.7, Apache-2.0 AND MIT, approved, #10347 maven/mavencentral/org.testcontainers/vault/1.19.7, MIT, approved, #10852 From 1662f39231cf6fb5197ecffba180ad2b333dbb4b Mon Sep 17 00:00:00 2001 From: Stiliyan Goranov Date: Tue, 9 Apr 2024 14:03:23 +0300 Subject: [PATCH 6/6] chore: remove unneeded sections from README --- core/common/connector-core/README.md | 4 ---- .../control-plane/transfer/transfer-data-plane/README.md | 4 ---- extensions/data-plane/data-plane-control-api/README.md | 4 ---- extensions/data-plane/data-plane-http/README.md | 4 ---- extensions/data-plane/data-plane-public-api/README.md | 4 ---- 5 files changed, 20 deletions(-) diff --git a/core/common/connector-core/README.md b/core/common/connector-core/README.md index 78e8dc50b3f..ca9b8fd2dec 100644 --- a/core/common/connector-core/README.md +++ b/core/common/connector-core/README.md @@ -1,7 +1,3 @@ # Connector-core Extension that registers default and core services as default implementations, http client, in memory stores and so on. - -## Configuration settings - -See [here](https://eclipse-edc.github.io/Connector/autodoc/#connector-core) the latest documentation for the available configuration parameters. diff --git a/extensions/control-plane/transfer/transfer-data-plane/README.md b/extensions/control-plane/transfer/transfer-data-plane/README.md index db654876e9f..e72fc087c9c 100644 --- a/extensions/control-plane/transfer/transfer-data-plane/README.md +++ b/extensions/control-plane/transfer/transfer-data-plane/README.md @@ -41,7 +41,3 @@ put these data into its Azure Blob Storage. This extension introduces a Control Plane endpoint used by the Data Plane for validating the access token received in input of its public API. OpenApi documentation can be found [here](../../../../resources/openapi/yaml/transfer-data-plane.yaml). - -### Configurations - -See [here](https://eclipse-edc.github.io/Connector/autodoc/#transfer-data-plane) the latest documentation for the available configuration parameters. diff --git a/extensions/data-plane/data-plane-control-api/README.md b/extensions/data-plane/data-plane-control-api/README.md index b288089da4a..c25fc3fd3b3 100644 --- a/extensions/data-plane/data-plane-control-api/README.md +++ b/extensions/data-plane/data-plane-control-api/README.md @@ -48,10 +48,6 @@ _Provide some information about dependencies, e.g., used extensions._ |:--------|:---------------------------------------------| | web-spi | Essentially for the Controllers registration | -### Configurations - -See [here](https://eclipse-edc.github.io/Connector/autodoc/#data-plane-control-api) the latest documentation for the available configuration parameters. - ## Design Principles Both public and control APIs rely on the `DataPlaneManager` for executing the actual data transfer, see [Data Plane Framework](../../../core/data-plane/data-plane-framework/README.md) for more details. diff --git a/extensions/data-plane/data-plane-http/README.md b/extensions/data-plane/data-plane-http/README.md index 1d2cd3f9477..60376020773 100644 --- a/extensions/data-plane/data-plane-http/README.md +++ b/extensions/data-plane/data-plane-http/README.md @@ -21,10 +21,6 @@ Typically, this extension is used to fetch or post data from/to a REST endpoint. |:-------------------------------------|:----------------------| | extensions:data-plane:data-plane-spi | SPI of the data plane | -### Configurations - -See [here](https://eclipse-edc.github.io/Connector/autodoc/#data-plane-http) the latest documentation for the available configuration parameters. - ### Provided Services #### `HttpRequestParamsProvider` diff --git a/extensions/data-plane/data-plane-public-api/README.md b/extensions/data-plane/data-plane-public-api/README.md index 8511719389f..ae975c34dbd 100644 --- a/extensions/data-plane/data-plane-public-api/README.md +++ b/extensions/data-plane/data-plane-public-api/README.md @@ -1,5 +1 @@ # Data Plane Public API - -### Configurations - -See [here](https://eclipse-edc.github.io/Connector/autodoc/#data-plane-public-api) the latest documentation for the available configuration parameters.