Skip to content

Commit bd8d625

Browse files
committed
Adapt to Debezium upgrade 3.5.0
- regen - adapt code for deprecated fields Signed-off-by: Aurélien Pupier <apupier@ibm.com>
1 parent 256bdd8 commit bd8d625

File tree

49 files changed

+2266
-1100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2266
-1100
lines changed

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/debezium-db2.json

Lines changed: 40 additions & 38 deletions
Large diffs are not rendered by default.

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/debezium-mongodb.json

Lines changed: 28 additions & 26 deletions
Large diffs are not rendered by default.

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/debezium-mysql.json

Lines changed: 220 additions & 214 deletions
Large diffs are not rendered by default.

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/debezium-oracle.json

Lines changed: 188 additions & 176 deletions
Large diffs are not rendered by default.

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/debezium-postgres.json

Lines changed: 50 additions & 48 deletions
Large diffs are not rendered by default.

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/debezium-sqlserver.json

Lines changed: 42 additions & 40 deletions
Large diffs are not rendered by default.

components/camel-debezium/camel-debezium-common/camel-debezium-maven-plugin/src/main/java/org/apache/camel/maven/config/ConnectorConfigFieldsFactory.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,19 @@ private static Set<String> getDeprecatedFieldsFromConfigClass(final Class<?> con
7676

7777
private static String retrieveDbzFieldWithReflection(final java.lang.reflect.Field reflectionField) {
7878
try {
79-
return ((Field) reflectionField.get(null)).name();
79+
Object object = reflectionField.get(null);
80+
if (object instanceof Field field) {
81+
return field.name();
82+
} else if (object instanceof String fieldString) {
83+
String removedDotAndCapitalize = Stream
84+
.of(fieldString.split("."))
85+
.map(field -> StringUtils.capitalize(field))
86+
.collect(Collectors.joining(""));
87+
return StringUtils.uncapitalize(removedDotAndCapitalize);
88+
} else {
89+
throw new IllegalArgumentException(
90+
"Error occurred in field : " + reflectionField.getName() + " retrieved value is " + object);
91+
}
8092
} catch (IllegalAccessException e) {
8193
throw new IllegalArgumentException("Error occurred in field : " + reflectionField.getName());
8294
}

components/camel-debezium/camel-debezium-db2/src/generated/java/org/apache/camel/component/debezium/db2/DebeziumDb2ComponentConfigurer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
176176
case "snapshotIncludeCollectionList": getOrCreateConfiguration(target).setSnapshotIncludeCollectionList(property(camelContext, java.lang.String.class, value)); return true;
177177
case "snapshotlocktimeoutms":
178178
case "snapshotLockTimeoutMs": getOrCreateConfiguration(target).setSnapshotLockTimeoutMs(property(camelContext, java.time.Duration.class, value).toMillis()); return true;
179+
case "snapshotmaxthreadsmultiplier":
180+
case "snapshotMaxThreadsMultiplier": getOrCreateConfiguration(target).setSnapshotMaxThreadsMultiplier(property(camelContext, int.class, value)); return true;
179181
case "snapshotmode":
180182
case "snapshotMode": getOrCreateConfiguration(target).setSnapshotMode(property(camelContext, java.lang.String.class, value)); return true;
181183
case "snapshotmodeconfigurationbasedsnapshotdata":
@@ -367,6 +369,8 @@ public Class<?> getOptionType(String name, boolean ignoreCase) {
367369
case "snapshotIncludeCollectionList": return java.lang.String.class;
368370
case "snapshotlocktimeoutms":
369371
case "snapshotLockTimeoutMs": return long.class;
372+
case "snapshotmaxthreadsmultiplier":
373+
case "snapshotMaxThreadsMultiplier": return int.class;
370374
case "snapshotmode":
371375
case "snapshotMode": return java.lang.String.class;
372376
case "snapshotmodeconfigurationbasedsnapshotdata":
@@ -559,6 +563,8 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
559563
case "snapshotIncludeCollectionList": return getOrCreateConfiguration(target).getSnapshotIncludeCollectionList();
560564
case "snapshotlocktimeoutms":
561565
case "snapshotLockTimeoutMs": return getOrCreateConfiguration(target).getSnapshotLockTimeoutMs();
566+
case "snapshotmaxthreadsmultiplier":
567+
case "snapshotMaxThreadsMultiplier": return getOrCreateConfiguration(target).getSnapshotMaxThreadsMultiplier();
562568
case "snapshotmode":
563569
case "snapshotMode": return getOrCreateConfiguration(target).getSnapshotMode();
564570
case "snapshotmodeconfigurationbasedsnapshotdata":

components/camel-debezium/camel-debezium-db2/src/generated/java/org/apache/camel/component/debezium/db2/DebeziumDb2EndpointConfigurer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj
170170
case "snapshotIncludeCollectionList": target.getConfiguration().setSnapshotIncludeCollectionList(property(camelContext, java.lang.String.class, value)); return true;
171171
case "snapshotlocktimeoutms":
172172
case "snapshotLockTimeoutMs": target.getConfiguration().setSnapshotLockTimeoutMs(property(camelContext, java.time.Duration.class, value).toMillis()); return true;
173+
case "snapshotmaxthreadsmultiplier":
174+
case "snapshotMaxThreadsMultiplier": target.getConfiguration().setSnapshotMaxThreadsMultiplier(property(camelContext, int.class, value)); return true;
173175
case "snapshotmode":
174176
case "snapshotMode": target.getConfiguration().setSnapshotMode(property(camelContext, java.lang.String.class, value)); return true;
175177
case "snapshotmodeconfigurationbasedsnapshotdata":
@@ -362,6 +364,8 @@ public Class<?> getOptionType(String name, boolean ignoreCase) {
362364
case "snapshotIncludeCollectionList": return java.lang.String.class;
363365
case "snapshotlocktimeoutms":
364366
case "snapshotLockTimeoutMs": return long.class;
367+
case "snapshotmaxthreadsmultiplier":
368+
case "snapshotMaxThreadsMultiplier": return int.class;
365369
case "snapshotmode":
366370
case "snapshotMode": return java.lang.String.class;
367371
case "snapshotmodeconfigurationbasedsnapshotdata":
@@ -555,6 +559,8 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
555559
case "snapshotIncludeCollectionList": return target.getConfiguration().getSnapshotIncludeCollectionList();
556560
case "snapshotlocktimeoutms":
557561
case "snapshotLockTimeoutMs": return target.getConfiguration().getSnapshotLockTimeoutMs();
562+
case "snapshotmaxthreadsmultiplier":
563+
case "snapshotMaxThreadsMultiplier": return target.getConfiguration().getSnapshotMaxThreadsMultiplier();
558564
case "snapshotmode":
559565
case "snapshotMode": return target.getConfiguration().getSnapshotMode();
560566
case "snapshotmodeconfigurationbasedsnapshotdata":

components/camel-debezium/camel-debezium-db2/src/generated/java/org/apache/camel/component/debezium/db2/DebeziumDb2EndpointUriFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class DebeziumDb2EndpointUriFactory extends org.apache.camel.support.comp
2323
private static final Set<String> SECRET_PROPERTY_NAMES;
2424
private static final Map<String, String> MULTI_VALUE_PREFIXES;
2525
static {
26-
Set<String> props = new HashSet<>(94);
26+
Set<String> props = new HashSet<>(95);
2727
props.add("additionalProperties");
2828
props.add("bridgeErrorHandler");
2929
props.add("cdcChangeTablesSchema");
@@ -99,6 +99,7 @@ public class DebeziumDb2EndpointUriFactory extends org.apache.camel.support.comp
9999
props.add("snapshotFetchSize");
100100
props.add("snapshotIncludeCollectionList");
101101
props.add("snapshotLockTimeoutMs");
102+
props.add("snapshotMaxThreadsMultiplier");
102103
props.add("snapshotMode");
103104
props.add("snapshotModeConfigurationBasedSnapshotData");
104105
props.add("snapshotModeConfigurationBasedSnapshotOnDataError");

0 commit comments

Comments
 (0)