ppalaga commented on a change in pull request #1215: URL: https://github.com/apache/camel-quarkus/pull/1215#discussion_r426609721
########## File path: docs/modules/ROOT/pages/extensions/debezium-postgres.adoc ########## @@ -0,0 +1,30 @@ +[[debezium-postgres]] += Debezium Postgres Extension + +*Since Camel Quarkus 1.0.0-M8* Review comment: ```suggestion *Since Camel Quarkus 1.0.0-M6* ``` ########## File path: docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc ########## @@ -226,8 +226,8 @@ Level | Since | Description Preview | 1.0.0-M6 | Capture changes from a MySQL database. | link:https://camel.apache.org/components/latest/debezium-postgres-component.html[Debezium PostgresSQL Connector] (camel-quarkus-debezium-postgres) + -`debezium-postgres:name` | JVM + - Preview | 1.0.0-M6 | Capture changes from a PostgresSQL database. +`debezium-postgres:name` | Native + + Stable | 1.0.0-M8 | Capture changes from a PostgresSQL database. Review comment: ```suggestion Stable | 1.0.0-M6 | Capture changes from a PostgresSQL database. ``` ########## File path: extensions/debezium-postgres/deployment/src/main/java/org/apache/camel/quarkus/component/debezium/postgres/deployment/DebeziumPostgresProcessor.java ########## @@ -0,0 +1,64 @@ +/* + * 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.postgres.deployment; + +import java.util.ArrayList; + +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; + +import static java.util.stream.Collectors.toCollection; + +class DebeziumPostgresProcessor { + + private static final String FEATURE = "camel-debezium-postgres"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + @BuildStep + ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) { + IndexView index = combinedIndex.getIndex(); + + ArrayList<String> dtos = index.getKnownClasses().stream().map(ci -> ci.name().toString()) + .filter(n -> n.startsWith("org.apache.kafka.connect.json") + || n.startsWith("io.debezium.connector.postgresql.PostgresConnector") + || n.startsWith("io.debezium.embedded.spi")) + .sorted() + .collect(toCollection(ArrayList::new)); + + dtos.add("org.apache.kafka.connect.storage.FileOffsetBackingStore"); + dtos.add("org.apache.kafka.connect.storage.MemoryOffsetBackingStore"); Review comment: Wouldn't these two actually be fine with `new ReflectiveClassBuildItem(false, false, ...` (constructor-only reflection)? ########## File path: extensions/debezium-postgres/deployment/src/main/java/org/apache/camel/quarkus/component/debezium/postgres/deployment/DebeziumPostgresProcessor.java ########## @@ -0,0 +1,64 @@ +/* + * 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.postgres.deployment; + +import java.util.ArrayList; + +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; + +import static java.util.stream.Collectors.toCollection; + +class DebeziumPostgresProcessor { + + private static final String FEATURE = "camel-debezium-postgres"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + @BuildStep + ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) { + IndexView index = combinedIndex.getIndex(); + + ArrayList<String> dtos = index.getKnownClasses().stream().map(ci -> ci.name().toString()) + .filter(n -> n.startsWith("org.apache.kafka.connect.json") + || n.startsWith("io.debezium.connector.postgresql.PostgresConnector") Review comment: If we are adding `new IndexDependencyBuildItem("io.debezium", "debezium-connector-postgres")` only because of `io.debezium.connector.postgresql.PostgresConnector`, then hardcoding a literal like with the `BackingStore`s below would be more effective. ########## File path: extensions/debezium-postgres/runtime/src/main/resources/META-INF/beans.xml ########## @@ -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. + +--> Review comment: `beans.xml` should not be necessary. ---------------------------------------------------------------- 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