You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ob...@apache.org on 2023/10/03 15:53:07 UTC
[streampipes] branch obermeier-patch-1 created (now fca2ada96)
This is an automated email from the ASF dual-hosted git repository.
obermeier pushed a change to branch obermeier-patch-1
in repository https://gitbox.apache.org/repos/asf/streampipes.git
at fca2ada96 Set default Kafka auto offset explicitly if it is not defined (#1992)
This branch includes the following new commits:
new fca2ada96 Set default Kafka auto offset explicitly if it is not defined (#1992)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[streampipes] 01/01: Set default Kafka auto offset explicitly if it is not defined (#1992)
Posted by ob...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
obermeier pushed a commit to branch obermeier-patch-1
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit fca2ada9636739fcbced029dee59db22a7372a44
Author: Stefan Obermeier <ob...@apache.org>
AuthorDate: Tue Oct 3 17:53:02 2023 +0200
Set default Kafka auto offset explicitly if it is not defined (#1992)
---
.../pe/shared/config/kafka/kafka/KafkaConnectUtils.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/streampipes-extensions/streampipes-pipeline-elements-shared/src/main/java/org/apache/streampipes/pe/shared/config/kafka/kafka/KafkaConnectUtils.java b/streampipes-extensions/streampipes-pipeline-elements-shared/src/main/java/org/apache/streampipes/pe/shared/config/kafka/kafka/KafkaConnectUtils.java
index 6ad3f61db..1e34ab1b0 100644
--- a/streampipes-extensions/streampipes-pipeline-elements-shared/src/main/java/org/apache/streampipes/pe/shared/config/kafka/kafka/KafkaConnectUtils.java
+++ b/streampipes-extensions/streampipes-pipeline-elements-shared/src/main/java/org/apache/streampipes/pe/shared/config/kafka/kafka/KafkaConnectUtils.java
@@ -123,10 +123,17 @@ public class KafkaConnectUtils {
new KafkaSecurityUnauthenticatedPlainConfig();
}
+ // Set default value if no value is provided.
+ if (alternatives == null) {
+ AutoOffsetResetConfig autoOffsetResetConfig = new AutoOffsetResetConfig(KafkaConnectUtils.LATEST);
+ return new KafkaConfig(brokerUrl, port, topic, securityConfig, autoOffsetResetConfig);
+ } else {
+ String auto = extractor.selectedAlternativeInternalId(AUTO_OFFSET_RESET_CONFIG);
+ AutoOffsetResetConfig autoOffsetResetConfig = new AutoOffsetResetConfig(auto);
- String auto = extractor.selectedAlternativeInternalId(AUTO_OFFSET_RESET_CONFIG);
- AutoOffsetResetConfig autoOffsetResetConfig = new AutoOffsetResetConfig(auto);
+ return new KafkaConfig(brokerUrl, port, topic, securityConfig, autoOffsetResetConfig);
+ }
return new KafkaConfig(brokerUrl, port, topic, securityConfig, autoOffsetResetConfig);
}