You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/10/20 06:41:35 UTC
[camel] branch master updated: CAMEL-14087: Ignore serverID default
configuration from the maven plugin and let debezium handle that (#3267)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 17ba4be CAMEL-14087: Ignore serverID default configuration from the maven plugin and let debezium handle that (#3267)
17ba4be is described below
commit 17ba4be4b1235330565eaf03d869b3adf89cf2f6
Author: Omar Al-Safi <om...@gmail.com>
AuthorDate: Sun Oct 20 08:41:13 2019 +0200
CAMEL-14087: Ignore serverID default configuration from the maven plugin and let debezium handle that (#3267)
---
.../apache/camel/maven/config/ConnectorConfigGenerator.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/components/camel-debezium/camel-debezium-maven-plugin/src/main/java/org/apache/camel/maven/config/ConnectorConfigGenerator.java b/components/camel-debezium/camel-debezium-maven-plugin/src/main/java/org/apache/camel/maven/config/ConnectorConfigGenerator.java
index f7864a5..5b5fed7 100644
--- a/components/camel-debezium/camel-debezium-maven-plugin/src/main/java/org/apache/camel/maven/config/ConnectorConfigGenerator.java
+++ b/components/camel-debezium/camel-debezium-maven-plugin/src/main/java/org/apache/camel/maven/config/ConnectorConfigGenerator.java
@@ -175,8 +175,12 @@ public final class ConnectorConfigGenerator {
final org.apache.camel.maven.packaging.srcgen.Field field = javaClass.addField()
.setName(fieldConfig.getFieldName())
.setType(fieldConfig.getRawType())
- .setPrivate()
- .setLiteralInitializer(fieldConfig.getDefaultValueAsString());
+ .setPrivate();
+
+ // especial case for database.server.id, we don't set the default value, we let debezium do that
+ if (!fieldConfig.getRawName().equals("database.server.id")) {
+ field.setLiteralInitializer(fieldConfig.getDefaultValueAsString());
+ }
String description = fieldConfig.getDescription();
@@ -189,7 +193,8 @@ public final class ConnectorConfigGenerator {
final Annotation annotation = field.addAnnotation(UriParam.class)
.setLiteralValue("label", "LABEL_NAME");
- if (fieldConfig.getDefaultValue() != null) {
+ // especial case for database.server.id, we don't set the default value, we let debezium do that
+ if (fieldConfig.getDefaultValue() != null && !fieldConfig.getRawName().equals("database.server.id")) {
annotation.setLiteralValue("defaultValue", String.format("\"%s\"", fieldConfig.getDefaultValue()));
}