jamesnetherton commented on a change in pull request #1258:
URL: https://github.com/apache/camel-quarkus/pull/1258#discussion_r429114646



##########
File path: .github/test-categories.yaml
##########
@@ -32,6 +32,7 @@ main:
   - main-xml-jaxb
 database:
   - couchdb
+  - debezium-mysql

Review comment:
       We could perhaps combine these under a single debezium itests module. 
Otherwise we have to do the native compilation step on every debezium itest we 
add.

##########
File path: 
extensions/debezium-mysql/deployment/src/main/java/org/apache/camel/quarkus/component/debezium/mysql/deployment/DebeziumMysqlProcessor.java
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.debezium.mysql.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.jboss.jandex.IndexView;
+
+class DebeziumMysqlProcessor {
+
+    private static final String FEATURE = "camel-debezium-mysql";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem 
combinedIndex) {

Review comment:
       If this is going to be required for every camel-debezium extension, it'd 
be better to push it into a common debezium-support extension.

##########
File path: 
extensions/debezium-mysql/deployment/src/main/java/org/apache/camel/quarkus/component/debezium/mysql/deployment/DebeziumMysqlProcessor.java
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.debezium.mysql.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.jboss.jandex.IndexView;
+
+class DebeziumMysqlProcessor {
+
+    private static final String FEATURE = "camel-debezium-mysql";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem 
combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        String[] dtos = index.getKnownClasses().stream().map(ci -> 
ci.name().toString())
+                .filter(n -> n.startsWith("org.apache.kafka.connect.json")
+                        || n.startsWith("io.debezium.embedded.spi"))
+                .sorted()
+                .toArray(String[]::new);
+
+        return new ReflectiveClassBuildItem(false, true, dtos);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem reflectiveClasses() {
+        return new ReflectiveClassBuildItem(false, false,
+                new String[] { 
"org.apache.kafka.connect.storage.FileOffsetBackingStore",
+                        
"org.apache.kafka.connect.storage.MemoryOffsetBackingStore",
+                        "io.debezium.connector.mysql.MySqlConnector",
+                        "io.debezium.connector.mysql.MySqlConnectorTask",
+                        "io.debezium.relational.history.FileDatabaseHistory" 
});
+    }
+
+    @BuildStep
+    void addDependencies(BuildProducer<IndexDependencyBuildItem> 
indexDependency) {

Review comment:
       Similar to previous comments. Apart from the connector, this seems 
likely to be required in all the debezium extensions so would be better located 
in a common place.

##########
File path: extensions/debezium-mysql/deployment/pom.xml
##########
@@ -17,7 +17,9 @@
     limitations under the License.
 
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+<project xmlns="http://maven.apache.org/POM/4.0.0";

Review comment:
       Lets leave the format of the project tags as is.

##########
File path: 
extensions/debezium-mysql/deployment/src/main/java/org/apache/camel/quarkus/component/debezium/mysql/deployment/DebeziumMysqlProcessor.java
##########
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.debezium.mysql.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.jboss.jandex.IndexView;
+
+class DebeziumMysqlProcessor {
+
+    private static final String FEATURE = "camel-debezium-mysql";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem 
combinedIndex) {
+        IndexView index = combinedIndex.getIndex();
+
+        String[] dtos = index.getKnownClasses().stream().map(ci -> 
ci.name().toString())
+                .filter(n -> n.startsWith("org.apache.kafka.connect.json")
+                        || n.startsWith("io.debezium.embedded.spi"))
+                .sorted()
+                .toArray(String[]::new);
+
+        return new ReflectiveClassBuildItem(false, true, dtos);
+    }
+
+    @BuildStep
+    ReflectiveClassBuildItem reflectiveClasses() {

Review comment:
       Aside from the Connector and ConnectorTask classes, the other items can 
probably pushed into a common debezium-support extension

##########
File path: 
integration-tests/debezium-mysql/src/main/resources/application.properties
##########
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+#quarkus.log.category."io".level=DEBUG

Review comment:
       Do we need this file? Presumably not if everything is commented out.

##########
File path: 
extensions/debezium-mysql/runtime/src/main/java/org/apache/camel/quarkus/component/debezium/mysql/SubstituteMetrics.java
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.debezium.mysql;
+
+import com.oracle.svm.core.annotate.Substitute;
+import com.oracle.svm.core.annotate.TargetClass;
+import org.slf4j.Logger;
+
+@TargetClass(io.debezium.metrics.Metrics.class)
+final class SubstituteMetrics {

Review comment:
       Duplicated with debezium-postgres so belongs in a common extension.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to