ppalaga commented on a change in pull request #1215: URL: https://github.com/apache/camel-quarkus/pull/1215#discussion_r426529895
########## File path: .github/test-categories.yaml ########## @@ -31,6 +31,7 @@ main: - main-xml-io - main-xml-jaxb database: + - debezium-postgres Review comment: Could you please make the ordering alphabetic again when you touch this file next time? ########## File path: docs/modules/ROOT/pages/extensions/debezium-postgres.adoc ########## @@ -0,0 +1,38 @@ +[[debezium-postgres]] += Debezium Postgres Extension + +*Since Camel Quarkus 1.0.0-M8* + +*Only consumer is supported* + +The Debezium PostgresSQL component is wrapper around https://debezium.io/[Debezium] using +https://debezium.io/documentation/reference/0.9/operations/embedded.html[Debezium Embedded], which enables Change Data +Capture from PostgresSQL database using Debezium without the need for Kafka or Kafka Connect. + +[source,xml] +------------------------------------------------------------ +<dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-debezium-postgres</artifactId> +</dependency> +------------------------------------------------------------ + +== Usage + +The extension provides support for the Camel https://camel.apache.org/components/latest/debezium-postgres-component.html[Debezium Posgtgres Connector]. Review comment: ```suggestion The extension provides support for the Camel https://camel.apache.org/components/latest/debezium-postgres-component.html[Debezium Postgres Connector]. ``` ########## File path: integration-tests/debezium-postgres/pom.xml ########## @@ -56,11 +70,48 @@ <artifactId>quarkus-junit5</artifactId> <scope>test</scope> </dependency> + <dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <scope>test</scope> </dependency> + +<!-- <dependency>--> +<!-- <groupId>org.apache.camel.quarkus</groupId>--> +<!-- <artifactId>camel-quarkus-kafka</artifactId>--> +<!-- </dependency>--> + + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-direct</artifactId> + </dependency> + + <!-- test dependencies - camel-quarkus --> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-integration-testcontainers-support</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.testcontainers</groupId> + <artifactId>postgresql</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-jdbc-postgresql</artifactId> + <scope>test</scope> + </dependency> Review comment: I think this should not be necessary. Is it perhaps some leftover? ########## 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: What is the purpose of this file? ########## File path: integration-tests/debezium-postgres/pom.xml ########## @@ -56,11 +70,48 @@ <artifactId>quarkus-junit5</artifactId> <scope>test</scope> </dependency> + <dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <scope>test</scope> </dependency> + +<!-- <dependency>--> +<!-- <groupId>org.apache.camel.quarkus</groupId>--> +<!-- <artifactId>camel-quarkus-kafka</artifactId>--> +<!-- </dependency>--> Review comment: ```suggestion ``` ########## File path: integration-tests/debezium-postgres/src/test/java/org/apache/camel/quarkus/component/debezium/postgres/it/DebeziumPostgresTest.java ########## @@ -0,0 +1,120 @@ +/* + * 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.it; + +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.RestAssured; +import io.restassured.response.Response; +import org.jboss.logging.Logger; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.emptyOrNullString; +import static org.hamcrest.Matchers.is; + +@QuarkusTest +@QuarkusTestResource(DebeziumPostgresTestResource.class) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +class DebeziumPostgresTest { + private static final Logger LOG = Logger.getLogger(DebeziumPostgresTest.class); + + private static String COMPANY_1 = "Best Company"; + private static String COMPANY_2 = "Even Better Company"; + private static String CITY_1 = "Prague"; + private static String CITY_2 = "Paris"; + + private static int REPEAT_COUNT = 5; + + Connection connection; Review comment: It would perhaps be worth JavaDoc-ing that connection is set by DebeziumPostgresTestResource ########## File path: extensions/debezium-postgres/runtime/src/main/java/org/apache/camel/quarkus/component/debezium/postgres/graal/storage/NativeFileOffsetBackingStore.java ########## @@ -0,0 +1,24 @@ +/* + * 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.graal.storage; + +import io.quarkus.runtime.annotations.RegisterForReflection; +import org.apache.kafka.connect.storage.FileOffsetBackingStore; + +@RegisterForReflection +public class NativeFileOffsetBackingStore extends FileOffsetBackingStore { +} Review comment: Could we perhaps use `ReflectiveClassBuildItem` instead? ########## File path: extensions/debezium-postgres/runtime/pom.xml ########## @@ -30,7 +32,7 @@ <name>Camel Quarkus :: Debezium PostgresSQL Connector :: Runtime</name> <properties> - <firstVersion>1.0.0-M6</firstVersion> + <firstVersion>1.0.0-M8</firstVersion> Review comment: Do not change this. First version is M6, not M8. ########## File path: extensions/debezium-postgres/runtime/src/main/java/org/apache/camel/quarkus/component/debezium/postgres/graal/storage/NativeMemoryOffsetBackingStore.java ########## @@ -0,0 +1,23 @@ +/* + * 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.graal.storage; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public class NativeMemoryOffsetBackingStore extends org.apache.kafka.connect.storage.MemoryOffsetBackingStore { Review comment: Could we perhaps use `ReflectiveClassBuildItem` instead? ########## File path: docs/modules/ROOT/pages/extensions/debezium-postgres.adoc ########## @@ -0,0 +1,38 @@ +[[debezium-postgres]] += Debezium Postgres Extension + +*Since Camel Quarkus 1.0.0-M8* + +*Only consumer is supported* + +The Debezium PostgresSQL component is wrapper around https://debezium.io/[Debezium] using +https://debezium.io/documentation/reference/0.9/operations/embedded.html[Debezium Embedded], which enables Change Data +Capture from PostgresSQL database using Debezium without the need for Kafka or Kafka Connect. + +[source,xml] +------------------------------------------------------------ +<dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-debezium-postgres</artifactId> +</dependency> +------------------------------------------------------------ + +== Usage + +The extension provides support for the Camel https://camel.apache.org/components/latest/debezium-postgres-component.html[Debezium Posgtgres Connector]. + +=== Limitations + +Native offset stores implementation classes differ from standard ones and not all of them are supported in native mode. +Supported offset stores are: Review comment: Not sure what "standard" means here? Is it perhaps "the ones available in JVM mode"? ########## File path: extensions/debezium-postgres/runtime/src/main/resources/META-INF/quarkus-extension.yaml ########## @@ -24,8 +24,12 @@ name: "Camel Debezium PostgresSQL Connector" description: "Capture changes from a PostgresSQL database" metadata: - unlisted: true - guide: "https://camel.apache.org/components/latest/debezium-postgres-component.html" + keywords: + - "camel" + - "database" + - "postgres" + - "sql" + guide: "https://quarkus.io/guides/camel" categories: - "integration" - status: "preview" + status: "stable" Review comment: Could you please re-generate this file by running `mvn -N cq:update-quarkus-metadata` from the repo root folder? ########## File path: integration-tests/debezium-postgres/pom.xml ########## @@ -40,6 +42,18 @@ <mvnd.builder.rule>camel-quarkus-debezium-postgres-deployment,camel-quarkus-support-policy-deployment</mvnd.builder.rule> </properties> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom-test</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> Review comment: ```suggestion ``` Since recently, this happens automatically for all tests in `camel-quarkus-build-parent-it` higher in hierarchy. ---------------------------------------------------------------- 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