This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch camel-main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit c643b91941110c70eb394f2378ebdf0012f6eb71 Author: Aurélien Pupier <[email protected]> AuthorDate: Fri Feb 27 17:10:06 2026 +0100 Remove Nitrite component it was deprecated in Camel 4.10 and removed in 4.19 fixes #8246 Signed-off-by: Aurélien Pupier <[email protected]> --- .github/workflows/check-dependency-convergence.yml | 2 +- catalog/pom.xml | 13 - docs/modules/ROOT/examples/components/nitrite.yml | 13 - docs/modules/ROOT/nav.adoc | 1 - .../ROOT/pages/reference/extensions/nitrite.adoc | 58 ----- extensions/nitrite/deployment/pom.xml | 65 ----- .../nitrite/deployment/NitriteProcessor.java | 69 ----- extensions/nitrite/pom.xml | 37 --- extensions/nitrite/runtime/pom.xml | 79 ------ extensions/nitrite/runtime/src/main/doc/usage.adoc | 8 - .../nitrite/graal/PodamSubstitutions.java | 107 -------- .../main/resources/META-INF/quarkus-extension.yaml | 34 --- extensions/pom.xml | 1 - integration-tests/nitrite/pom.xml | 116 --------- .../quarkus/component/nitrite/it/Employee.java | 81 ------ .../component/nitrite/it/EmployeeMappable.java | 79 ------ .../component/nitrite/it/EmployeeSerializable.java | 52 ---- .../component/nitrite/it/NitriteResource.java | 145 ----------- .../quarkus/component/nitrite/it/Operation.java | 147 ----------- .../src/main/resources/application.properties | 19 -- .../main/resources/my-serialization-config.json | 7 - .../quarkus/component/nitrite/it/NitriteIT.java | 26 -- .../quarkus/component/nitrite/it/NitriteTest.java | 277 --------------------- .../component/nitrite/it/NitriteTestResource.java | 59 ----- integration-tests/pom.xml | 1 - poms/bom/pom.xml | 21 -- poms/bom/src/main/generated/flattened-full-pom.xml | 21 -- .../src/main/generated/flattened-reduced-pom.xml | 21 -- .../generated/flattened-reduced-verbose-pom.xml | 21 -- tooling/scripts/test-categories.yaml | 1 - 30 files changed, 1 insertion(+), 1580 deletions(-) diff --git a/.github/workflows/check-dependency-convergence.yml b/.github/workflows/check-dependency-convergence.yml index aee6c7c27f..d6eca57b1a 100644 --- a/.github/workflows/check-dependency-convergence.yml +++ b/.github/workflows/check-dependency-convergence.yml @@ -119,7 +119,7 @@ jobs: "org.apache.mina:mina-core" # Mismatch between camel-quarkus-jcr & camel-quarkus-tika "org.apache.tika:tika-core" - # Mismatch between camel-quarkus-flink, camel-quarkus-junit5, camel-quarkus-nitrite & camel-quarkus-redis + # Mismatch between camel-quarkus-flink, camel-quarkus-junit5 & camel-quarkus-redis "org.objenesis:objenesis" # Mismatch between camel-quarkus-rest-openapi-deployment & camel-quarkus-smallrye-reactive-messaging-deployment "org.commonmark:commonmark" diff --git a/catalog/pom.xml b/catalog/pom.xml index c722534bb8..2c4b1912f0 100644 --- a/catalog/pom.xml +++ b/catalog/pom.xml @@ -3048,19 +3048,6 @@ </exclusion> </exclusions> </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite</artifactId> - <version>${project.version}</version> - <type>pom</type> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>*</groupId> - <artifactId>*</artifactId> - </exclusion> - </exclusions> - </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-oaipmh</artifactId> diff --git a/docs/modules/ROOT/examples/components/nitrite.yml b/docs/modules/ROOT/examples/components/nitrite.yml deleted file mode 100644 index 9e0d9d023b..0000000000 --- a/docs/modules/ROOT/examples/components/nitrite.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Do not edit directly! -# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page -cqArtifactId: camel-quarkus-nitrite -cqArtifactIdBase: nitrite -cqNativeSupported: true -cqStatus: Stable -cqDeprecated: true -cqJvmSince: 1.0.0 -cqNativeSince: 1.8.0 -cqCamelPartName: nitrite -cqCamelPartTitle: Nitrite -cqCamelPartDescription: Access Nitrite databases. -cqExtensionPageTitle: Nitrite diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index b18d5720ce..916c7647f1 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -245,7 +245,6 @@ *** xref:reference/extensions/nats.adoc[Nats] *** xref:reference/extensions/netty.adoc[Netty] *** xref:reference/extensions/netty-http.adoc[Netty HTTP] -*** xref:reference/extensions/nitrite.adoc[Nitrite] *** xref:reference/extensions/oaipmh.adoc[OAI-PMH] *** xref:reference/extensions/ognl.adoc[OGNL] *** xref:reference/extensions/milo.adoc[OPC UA Browser] diff --git a/docs/modules/ROOT/pages/reference/extensions/nitrite.adoc b/docs/modules/ROOT/pages/reference/extensions/nitrite.adoc deleted file mode 100644 index 9bef7a179d..0000000000 --- a/docs/modules/ROOT/pages/reference/extensions/nitrite.adoc +++ /dev/null @@ -1,58 +0,0 @@ -// Do not edit directly! -// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page -[id="extensions-nitrite"] -= Nitrite -:page-aliases: extensions/nitrite.adoc -:linkattrs: -:cq-artifact-id: camel-quarkus-nitrite -:cq-native-supported: true -:cq-status: Stable -:cq-status-deprecation: Stable Deprecated -:cq-description: Access Nitrite databases. -:cq-deprecated: true -:cq-jvm-since: 1.0.0 -:cq-native-since: 1.8.0 - -ifeval::[{doc-show-badges} == true] -[.badges] -[.badge-key]##JVM since##[.badge-supported]##1.0.0## [.badge-key]##Native since##[.badge-supported]##1.8.0## [.badge-key]##⚠️##[.badge-unsupported]##Deprecated## -endif::[] - -Access Nitrite databases. - -[id="extensions-nitrite-whats-inside"] -== What's inside - -* xref:{cq-camel-components}::nitrite-component.adoc[Nitrite component], URI syntax: `nitrite:database` - -Please refer to the above link for usage and configuration details. - -[id="extensions-nitrite-maven-coordinates"] -== Maven coordinates - -https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-nitrite[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"] - -Or add the coordinates to your existing project: - -[source,xml] ----- -<dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite</artifactId> -</dependency> ----- -ifeval::[{doc-show-user-guide-link} == true] -Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications. -endif::[] - -[id="extensions-nitrite-usage"] -== Usage -If your persistence objects in native mode implement `java.io.Serializable` and are not automatically registered for serialization, -you have to register them for serialization. Look into xref:extensions/core.adoc#quarkus-camel-native-reflection-serialization-enabled[documentation] -to see which classes are registered and how to register other ones. - - -If your persistence objects implement `org.dizitart.no2.mapper.Mappable`. All classes have to -implement also `java.io.Serializable` and have to be registered for serialization (see previous option), -even though the Java serialization won't be used. - diff --git a/extensions/nitrite/deployment/pom.xml b/extensions/nitrite/deployment/pom.xml deleted file mode 100644 index 992ddc7943..0000000000 --- a/extensions/nitrite/deployment/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite-parent</artifactId> - <version>3.33.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-nitrite-deployment</artifactId> - <name>Camel Quarkus :: Nitrite :: Deployment</name> - - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-core-deployment</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-support-httpclient-deployment</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths> - <path> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-processor</artifactId> - <version>${quarkus.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/extensions/nitrite/deployment/src/main/java/org/apache/camel/quarkus/component/nitrite/deployment/NitriteProcessor.java b/extensions/nitrite/deployment/src/main/java/org/apache/camel/quarkus/component/nitrite/deployment/NitriteProcessor.java deleted file mode 100644 index 2d908fcb91..0000000000 --- a/extensions/nitrite/deployment/src/main/java/org/apache/camel/quarkus/component/nitrite/deployment/NitriteProcessor.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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.nitrite.deployment; - -import java.util.concurrent.atomic.AtomicBoolean; - -import io.quarkus.deployment.annotations.BuildProducer; -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; -import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; -import org.apache.camel.quarkus.core.deployment.spi.CamelSerializationBuildItem; -import org.dizitart.no2.Document; -import org.dizitart.no2.Index; -import org.dizitart.no2.NitriteId; -import org.dizitart.no2.meta.Attributes; - -class NitriteProcessor { - - private static final String FEATURE = "camel-nitrite"; - - @BuildStep - FeatureBuildItem feature() { - return new FeatureBuildItem(FEATURE); - } - - @BuildStep - CamelSerializationBuildItem serialization() { - return new CamelSerializationBuildItem(); - } - - @BuildStep - RuntimeInitializedClassBuildItem runtimeInitializedClass() { - // this class uses a SecureRandom which needs to be initialised at run time - return new RuntimeInitializedClassBuildItem("org.dizitart.no2.Security"); - } - - @BuildStep - void reflectiveClasses(BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) { - reflectiveClasses.produce( - ReflectiveClassBuildItem.builder(org.h2.store.fs.FilePathNio.class).build()); - reflectiveClasses - .produce(ReflectiveClassBuildItem.builder("sun.reflect.ReflectionFactory").methods().build()); - - String[] dtos = new String[] { NitriteId.class.getName(), - Document.class.getName(), - Attributes.class.getName(), - "org.dizitart.no2.internals.IndexMetaService$IndexMeta", - AtomicBoolean.class.getName(), - Index.class.getName() }; - - reflectiveClasses.produce(ReflectiveClassBuildItem.serializationClass(dtos)); - - } -} diff --git a/extensions/nitrite/pom.xml b/extensions/nitrite/pom.xml deleted file mode 100644 index c6651d2f1f..0000000000 --- a/extensions/nitrite/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-extensions</artifactId> - <version>3.33.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-nitrite-parent</artifactId> - <name>Camel Quarkus :: Nitrite</name> - <packaging>pom</packaging> - - <modules> - <module>deployment</module> - <module>runtime</module> - </modules> -</project> diff --git a/extensions/nitrite/runtime/pom.xml b/extensions/nitrite/runtime/pom.xml deleted file mode 100644 index 547332b0c8..0000000000 --- a/extensions/nitrite/runtime/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite-parent</artifactId> - <version>3.33.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-nitrite</artifactId> - <name>Camel Quarkus :: Nitrite :: Runtime</name> - <description>Access Nitrite databases.</description> - - <properties> - <camel.quarkus.jvmSince>1.0.0</camel.quarkus.jvmSince> - <camel.quarkus.nativeSince>1.8.0</camel.quarkus.nativeSince> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-support-httpclient</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-nitrite</artifactId> - </dependency> - <dependency> - <groupId>org.graalvm.sdk</groupId> - <artifactId>nativeimage</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-maven-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths> - <path> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-processor</artifactId> - <version>${quarkus.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> -</project> diff --git a/extensions/nitrite/runtime/src/main/doc/usage.adoc b/extensions/nitrite/runtime/src/main/doc/usage.adoc deleted file mode 100644 index c418c9cbea..0000000000 --- a/extensions/nitrite/runtime/src/main/doc/usage.adoc +++ /dev/null @@ -1,8 +0,0 @@ -If your persistence objects in native mode implement `java.io.Serializable` and are not automatically registered for serialization, -you have to register them for serialization. Look into xref:extensions/core.adoc#quarkus-camel-native-reflection-serialization-enabled[documentation] -to see which classes are registered and how to register other ones. - - -If your persistence objects implement `org.dizitart.no2.mapper.Mappable`. All classes have to -implement also `java.io.Serializable` and have to be registered for serialization (see previous option), -even though the Java serialization won't be used. diff --git a/extensions/nitrite/runtime/src/main/java/org/apache/camel/quarkus/component/nitrite/graal/PodamSubstitutions.java b/extensions/nitrite/runtime/src/main/java/org/apache/camel/quarkus/component/nitrite/graal/PodamSubstitutions.java deleted file mode 100644 index 1fb3f80c88..0000000000 --- a/extensions/nitrite/runtime/src/main/java/org/apache/camel/quarkus/component/nitrite/graal/PodamSubstitutions.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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.nitrite.graal; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; -import uk.co.jemos.podam.api.AttributeMetadata; -import uk.co.jemos.podam.api.ClassAttribute; -import uk.co.jemos.podam.api.DataProviderStrategy; -import uk.co.jemos.podam.api.MapArguments; -import uk.co.jemos.podam.api.PodamFactoryImpl; -import uk.co.jemos.podam.common.ManufacturingContext; -import uk.co.jemos.podam.typeManufacturers.ArrayTypeManufacturerImpl; - -final public class PodamSubstitutions { - -} - -@TargetClass(PodamFactoryImpl.class) -final class PodamFactoryImplSubstitutions { - - @Substitute - private Object[] getParameterValuesForConstructor( - Constructor<?> constructor, Class<?> pojoClass, - ManufacturingContext manufacturingCtx, - Map map, - Type... genericTypeArgs) - throws InstantiationException, IllegalAccessException, - InvocationTargetException, ClassNotFoundException { - return new Object[0]; - } - - @Substitute - private Object[] getParameterValuesForMethod( - Method method, Class<?> pojoClass, - ManufacturingContext manufacturingCtx, Map<String, Type> typeArgsMap, - Type... genericTypeArgs) - throws InstantiationException, IllegalAccessException, - InvocationTargetException, ClassNotFoundException { - return new Object[0]; - } - - @Substitute - private void fillMap(MapArguments mapArguments, ManufacturingContext manufacturingCtx) - throws InstantiationException, IllegalAccessException, - InvocationTargetException, ClassNotFoundException { - } - - @Substitute - private void fillCollection(ManufacturingContext manufacturingCtx, - List<Annotation> annotations, String attributeName, - Collection<? super Object> collection, - Class<?> collectionElementType, Type... genericTypeArgs) - throws InstantiationException, IllegalAccessException, - InvocationTargetException, ClassNotFoundException { - } - - @Substitute - private void fillArray(Object array, String attributeName, Class<?> elementType, - Type genericElementType, List<Annotation> annotations, - ManufacturingContext manufacturingCtx, - Map<String, Type> typeArgsMap) - throws InstantiationException, IllegalAccessException, - InvocationTargetException, ClassNotFoundException { - } - - @Substitute - private <T> boolean populateReadWriteField(T pojo, ClassAttribute attribute, - Map<String, Type> typeArgsMap, ManufacturingContext manufacturingCtx) - throws InstantiationException, IllegalAccessException, - InvocationTargetException, ClassNotFoundException { - return false; - } -} - -@TargetClass(ArrayTypeManufacturerImpl.class) -final class ArrayTypeManufacturerImplSubstitutions { - @Substitute - public Cloneable getType(DataProviderStrategy strategy, - AttributeMetadata attributeMetadata, - Map<String, Type> genericTypesArgumentsMap) { - return null; - } -} diff --git a/extensions/nitrite/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/nitrite/runtime/src/main/resources/META-INF/quarkus-extension.yaml deleted file mode 100644 index 4684cb54ac..0000000000 --- a/extensions/nitrite/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# -# 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. -# - -# This is a generated file. Do not edit directly! -# To re-generate, run the following command from the top level directory: -# -# mvn -N cq:update-quarkus-metadata -# ---- -name: "Camel Nitrite" -description: "Access Nitrite databases" -metadata: - icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg" - sponsor: "Apache Software Foundation" - guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/nitrite.html" - categories: - - "integration" - status: - - "stable" - - "deprecated" \ No newline at end of file diff --git a/extensions/pom.xml b/extensions/pom.xml index 4d9f8d1abb..efeea2119c 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -213,7 +213,6 @@ <module>nats</module> <module>netty</module> <module>netty-http</module> - <module>nitrite</module> <module>oaipmh</module> <module>oauth</module> <module>observability-services</module> diff --git a/integration-tests/nitrite/pom.xml b/integration-tests/nitrite/pom.xml deleted file mode 100644 index 63e3b10c2a..0000000000 --- a/integration-tests/nitrite/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<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"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-build-parent-it</artifactId> - <version>3.33.0-SNAPSHOT</version> - <relativePath>../../poms/build-parent-it/pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-integration-test-nitrite</artifactId> - <name>Camel Quarkus :: Integration Tests :: Nitrite</name> - <description>Integration tests for Camel Quarkus Nitrite extension</description> - - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-resteasy</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-resteasy-jackson</artifactId> - </dependency> - - <!-- test dependencies --> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>io.rest-assured</groupId> - <artifactId>rest-assured</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <profiles> - <!-- TODO: https://github.com/apache/camel-quarkus/issues/8245 - <profile> - <id>native</id> - <activation> - <property> - <name>native</name> - </property> - </activation> - <properties> - <quarkus.native.enabled>true</quarkus.native.enabled> - </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>integration-test</goal> - <goal>verify</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - --> - <profile> - <id>virtualDependencies</id> - <activation> - <property> - <name>!noVirtualDependencies</name> - </property> - </activation> - <dependencies> - <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory --> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite-deployment</artifactId> - <version>${project.version}</version> - <type>pom</type> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>*</groupId> - <artifactId>*</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - </profile> - </profiles> - -</project> diff --git a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/Employee.java b/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/Employee.java deleted file mode 100644 index 0049567b61..0000000000 --- a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/Employee.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.nitrite.it; - -import java.io.Serializable; -import java.util.Date; - -public abstract class Employee implements Serializable, Cloneable { - - private Date joinDate; - - private String name; - - private String address; - - public Employee() { - } - - public Employee(long empId, Date joinDate, String name, String address) { - setEmpId(empId); - this.joinDate = joinDate; - this.name = name; - this.address = address; - } - - public abstract long getEmpId(); - - public abstract void setEmpId(long empId); - - public Date getJoinDate() { - return joinDate; - } - - public void setJoinDate(Date joinDate) { - this.joinDate = joinDate; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - @Override - public String toString() { - return "Employee{" + - "empId=" + getEmpId() + - ", joinDate=" + joinDate + - ", name='" + name + '\'' + - ", address='" + address + '\'' + - '}'; - } - - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } -} diff --git a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/EmployeeMappable.java b/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/EmployeeMappable.java deleted file mode 100644 index 7cc41b9f7a..0000000000 --- a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/EmployeeMappable.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.nitrite.it; - -import java.util.Date; - -import org.dizitart.no2.Document; -import org.dizitart.no2.IndexType; -import org.dizitart.no2.mapper.Mappable; -import org.dizitart.no2.mapper.NitriteMapper; -import org.dizitart.no2.objects.Id; -import org.dizitart.no2.objects.Index; -import org.dizitart.no2.objects.Indices; - -@Indices({ - @Index(value = "address", type = IndexType.NonUnique), - @Index(value = "name", type = IndexType.Unique) -}) -public class EmployeeMappable extends Employee implements Mappable { - - @Id - private long empId; - - public EmployeeMappable() { - } - - public EmployeeMappable(long empId, Date joinDate, String name, String address) { - super(empId, joinDate, name, address); - } - - public EmployeeMappable(EmployeeSerializable employee) { - super(employee.getEmpId(), employee.getJoinDate(), employee.getName(), employee.getAddress()); - } - - @Override - public long getEmpId() { - return empId; - } - - @Override - public void setEmpId(long empId) { - this.empId = empId; - } - - @Override - public Document write(NitriteMapper nitriteMapper) { - Document document = new Document(); - document.put("empId", getEmpId()); - document.put("name", getName()); - document.put("joiningDate", getJoinDate()); - document.put("address", getAddress()); - - return document; - } - - @Override - public void read(NitriteMapper nitriteMapper, Document document) { - if (document != null) { - setEmpId((Long) document.get("empId")); - setName((String) document.get("name")); - setJoinDate((Date) document.get("joiningDate")); - setAddress((String) document.get("address")); - } - } -} diff --git a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/EmployeeSerializable.java b/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/EmployeeSerializable.java deleted file mode 100644 index 87900b75be..0000000000 --- a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/EmployeeSerializable.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.nitrite.it; - -import java.util.Date; - -import org.dizitart.no2.IndexType; -import org.dizitart.no2.objects.Id; -import org.dizitart.no2.objects.Index; -import org.dizitart.no2.objects.Indices; - -@Indices({ - @Index(value = "address", type = IndexType.NonUnique), - @Index(value = "name", type = IndexType.Unique) -}) -public class EmployeeSerializable extends Employee { - - @Id - private long empId; - - public EmployeeSerializable() { - } - - public EmployeeSerializable(long empId, Date joinDate, String name, String address) { - super(empId, joinDate, name, address); - } - - @Override - public long getEmpId() { - return empId; - } - - @Override - public void setEmpId(long empId) { - this.empId = empId; - } - -} diff --git a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/NitriteResource.java b/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/NitriteResource.java deleted file mode 100644 index a63bbcf19e..0000000000 --- a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/NitriteResource.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * 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.nitrite.it; - -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.QueryParam; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import org.apache.camel.ConsumerTemplate; -import org.apache.camel.Exchange; -import org.apache.camel.FluentProducerTemplate; -import org.apache.camel.Message; -import org.apache.camel.component.nitrite.NitriteConstants; -import org.dizitart.no2.Document; -import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.jboss.logging.Logger; - -@Path("/nitrite") -@ApplicationScoped -public class NitriteResource { - private static final Logger LOG = Logger.getLogger(NitriteResource.class); - - public static final String PROPERTY_DB_FILE = "camel.quarkus.nitrite.test.db.file"; - - @ConfigProperty(name = PROPERTY_DB_FILE) - String dbFile; - - @Inject - FluentProducerTemplate producerTemplate; - - @Inject - ConsumerTemplate consumerTemplate; - - @Path("/getRepositoryClass") - @GET - @Produces(MediaType.APPLICATION_JSON) - public Response getRepositoryClass(@QueryParam("mappable") boolean mappable) throws Exception { - String className = mappable ? EmployeeMappable.class.getName() : EmployeeSerializable.class.getName(); - final Exchange exchange = consumerTemplate.receive(String.format("nitrite://%s?repositoryClass=%s", - dbFile, className), 2000); - if (exchange == null) { - return Response.noContent().build(); - } - final Message message = exchange.getMessage(); - return Response - .ok(message.getBody()) - .header(NitriteConstants.CHANGE_TYPE, message.getHeader(NitriteConstants.CHANGE_TYPE)) - .build(); - } - - @Path("/repositoryClass") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public Object postRepositoryClass(EmployeeSerializable object, @QueryParam("mappable") boolean mappable) { - String className = mappable ? EmployeeMappable.class.getName() : EmployeeSerializable.class.getName(); - //if object, is mappable, construct it from serializable (it is conversion caused by the type in method parameter) - Employee employee = object; - if (mappable) { - employee = new EmployeeMappable(object); - } - LOG.debugf("Sending to nitrite: {%s}", object); - return producerTemplate.toF("nitrite://%s?repositoryClass=%s", - dbFile, className) - .withBody(employee) - .withHeader(NitriteConstants.OPERATION, null) - .request(); - } - - @Path("/repositoryClassOperation") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public Object postRepositoryClassOperation(Operation operation, @QueryParam("mappable") boolean mappable) { - String className = mappable ? EmployeeMappable.class.getName() : EmployeeSerializable.class.getName(); - LOG.debugf("Sending to nitrite: {%s}", operation); - return producerTemplate.toF("nitrite://%s?repositoryClass=%s", - dbFile, className) - .withBody(mappable ? operation.getEmployeeMappable() : operation.getEmployeeSerializable()) - .withHeader(NitriteConstants.OPERATION, operation.toRepositoryOperation()) - .request(); - } - - @Path("/collection") - @GET - @Produces(MediaType.APPLICATION_JSON) - public Object collection() throws Exception { - final Exchange exchange = consumerTemplate.receive(String.format("nitrite://%s?collection=collection", - dbFile), 5000); - LOG.debugf("Received from nitrite: %s", exchange == null ? null : exchange.getIn().getBody()); - if (exchange == null) { - return Response.noContent().build(); - } - final Message message = exchange.getMessage(); - return Response - .ok(message.getBody()) - .header(NitriteConstants.CHANGE_TYPE, message.getHeader(NitriteConstants.CHANGE_TYPE)) - .build(); - } - - @Path("/collection") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public Object collection(Document doc) { - LOG.debugf("Sending to nitrite: {%s}", doc); - return producerTemplate.toF("nitrite://%s?collection=collection", dbFile) - .withBody(doc) - .withHeader(NitriteConstants.OPERATION, null) - .request(); - } - - @Path("/collectionOperation") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public Object collectionOperation(Operation operation) { - LOG.debugf("Sending to nitrite: {%s}", operation); - return producerTemplate.toF("nitrite://%s?collection=collection", - dbFile) - .withBody(operation.getDocument()) - .withHeader(NitriteConstants.OPERATION, operation.toCollectionOperation()) - .request(); - } -} diff --git a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/Operation.java b/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/Operation.java deleted file mode 100644 index c50410d2e0..0000000000 --- a/integration-tests/nitrite/src/main/java/org/apache/camel/quarkus/component/nitrite/it/Operation.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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.nitrite.it; - -import org.apache.camel.component.nitrite.operation.CollectionOperation; -import org.apache.camel.component.nitrite.operation.RepositoryOperation; -import org.apache.camel.component.nitrite.operation.collection.FindCollectionOperation; -import org.apache.camel.component.nitrite.operation.collection.RemoveCollectionOperation; -import org.apache.camel.component.nitrite.operation.collection.UpdateCollectionOperation; -import org.apache.camel.component.nitrite.operation.common.InsertOperation; -import org.apache.camel.component.nitrite.operation.repository.FindRepositoryOperation; -import org.apache.camel.component.nitrite.operation.repository.RemoveRepositoryOperation; -import org.apache.camel.component.nitrite.operation.repository.UpdateRepositoryOperation; -import org.dizitart.no2.Document; -import org.dizitart.no2.filters.Filters; -import org.dizitart.no2.objects.filters.ObjectFilters; - -public class Operation { - - enum Type { - update, find, delete, findGt, insert - }; - - private Type type; - - private String field; - - private Object value; - - private EmployeeSerializable employeeSerializable; - private EmployeeMappable employeeMappable; - private Document document; - - public Operation() { - } - - private Operation(Type type, String field, Object value) { - this.type = type; - this.field = field; - this.value = value; - } - - public Operation(Type type, String field, Object value, EmployeeSerializable employeeSerializable, - EmployeeMappable employeeMappable) { - this(type, field, value); - this.employeeSerializable = employeeSerializable; - this.employeeMappable = employeeMappable; - } - - public Operation(Type type, String field, Object value, Document document) { - this(type, field, value); - this.document = document; - } - - public Type getType() { - return type; - } - - public void setType(Type type) { - this.type = type; - } - - public String getField() { - return field; - } - - public void setField(String field) { - this.field = field; - } - - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - public Employee getEmployeeSerializable() { - return employeeSerializable; - } - - public void setEmployeeSerializable(EmployeeSerializable employeeSerializable) { - this.employeeSerializable = employeeSerializable; - } - - public EmployeeMappable getEmployeeMappable() { - return employeeMappable; - } - - public void setEmployeeMappable(EmployeeMappable employeeMappable) { - this.employeeMappable = employeeMappable; - } - - public Document getDocument() { - return document; - } - - public void setDocument(Document document) { - this.document = document; - } - - public RepositoryOperation toRepositoryOperation() { - - switch (type) { - case update: - return new UpdateRepositoryOperation(ObjectFilters.eq(field, value)); - case find: - return new FindRepositoryOperation(ObjectFilters.eq(field, value)); - case findGt: - return new FindRepositoryOperation(ObjectFilters.gt(field, value)); - case delete: - return new RemoveRepositoryOperation(ObjectFilters.eq(field, value)); - default: - throw new UnsupportedOperationException(); - } - } - - public CollectionOperation toCollectionOperation() { - switch (type) { - case update: - return new UpdateCollectionOperation(Filters.eq(field, value)); - case find: - return new FindCollectionOperation(Filters.eq(field, value)); - case delete: - return new RemoveCollectionOperation(Filters.eq(field, value)); - case insert: - return new InsertOperation(); - default: - throw new UnsupportedOperationException(); - } - } -} diff --git a/integration-tests/nitrite/src/main/resources/application.properties b/integration-tests/nitrite/src/main/resources/application.properties deleted file mode 100644 index 55f1ff8b94..0000000000 --- a/integration-tests/nitrite/src/main/resources/application.properties +++ /dev/null @@ -1,19 +0,0 @@ -## --------------------------------------------------------------------------- -## 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.native.additional-build-args=-H:SerializationConfigurationResources=my-serialization-config.json \ No newline at end of file diff --git a/integration-tests/nitrite/src/main/resources/my-serialization-config.json b/integration-tests/nitrite/src/main/resources/my-serialization-config.json deleted file mode 100644 index 636ce1ea82..0000000000 --- a/integration-tests/nitrite/src/main/resources/my-serialization-config.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "name" : "org.apache.camel.quarkus.component.nitrite.it.EmployeeSerializable" - },{ - "name" : "org.apache.camel.quarkus.component.nitrite.it.EmployeeMappable" - } -] \ No newline at end of file diff --git a/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteIT.java b/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteIT.java deleted file mode 100644 index 02b8b5e4fc..0000000000 --- a/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteIT.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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.nitrite.it; - -import io.quarkus.test.junit.DisabledOnIntegrationTest; -import io.quarkus.test.junit.QuarkusIntegrationTest; - -@DisabledOnIntegrationTest("https://github.com/apache/camel-quarkus/issues/8245") -@QuarkusIntegrationTest -class NitriteIT extends NitriteTest { - -} diff --git a/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteTest.java b/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteTest.java deleted file mode 100644 index f36072b466..0000000000 --- a/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteTest.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * 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.nitrite.it; - -import java.util.GregorianCalendar; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; -import io.restassured.RestAssured; -import io.restassured.http.ContentType; -import org.apache.camel.component.nitrite.NitriteConstants; -import org.dizitart.no2.Document; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; - -import static org.hamcrest.core.Is.is; - -@QuarkusTest -@QuarkusTestResource(NitriteTestResource.class) -@TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class NitriteTest { - - private static final EmployeeSerializable sheldonSerializable = new EmployeeSerializable(1L, - new GregorianCalendar(2010, 10, 1).getTime(), - "Sheldon", - "Alpha Centauri"); - private static final EmployeeSerializable leonardSerializable = new EmployeeSerializable(2L, - new GregorianCalendar(2015, 10, 1).getTime(), - "Leonard", "Earth"); - private static final EmployeeSerializable irmaSerializable = new EmployeeSerializable(3L, - new GregorianCalendar(2011, 10, 1).getTime(), - "Irma", - "Jupiter"); - - private static final EmployeeMappable sheldonMappable = new EmployeeMappable(1L, - new GregorianCalendar(2010, 10, 1).getTime(), - "Sheldon", - "Alpha Centauri"); - private static final EmployeeMappable leonardMappable = new EmployeeMappable(2L, - new GregorianCalendar(2015, 10, 1).getTime(), - "Leonard", "Earth"); - private static final EmployeeMappable irmaMappable = new EmployeeMappable(3L, new GregorianCalendar(2011, 10, 1).getTime(), - "Irma", - "Jupiter"); - - @Test - public void repositoryClassSerializable() throws CloneNotSupportedException { - testRepositoryClass(sheldonSerializable, leonardSerializable, irmaSerializable); - } - - @Test - public void repositoryClassMappable() throws CloneNotSupportedException { - testRepositoryClass(sheldonMappable, leonardMappable, irmaMappable); - } - - private void testRepositoryClass(Employee sheldon, Employee leonard, Employee irma) - throws CloneNotSupportedException { - boolean mappable = sheldon instanceof EmployeeMappable; - /* Make sure there is no event there before we start inserting */ - RestAssured.get("/nitrite/getRepositoryClass?mappable=" + mappable) - .then() - .statusCode(204); - - /* Insert Sheldon */ - RestAssured.given() - .contentType(ContentType.JSON) - .queryParam("mappable", mappable) - .body(sheldon) - .post("/nitrite/repositoryClass") - .then() - .statusCode(200) - .body("name", is("Sheldon")); - RestAssured.get("/nitrite/getRepositoryClass?mappable=" + mappable) - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "INSERT") - .body("name", is("Sheldon")); - - /* Insert Leonard */ - RestAssured.given() - .contentType(ContentType.JSON) - .queryParam("mappable", mappable) - .body(leonard) - .post("/nitrite/repositoryClass") - .then() - .statusCode(200) - .body("name", is("Leonard")); - RestAssured.get("/nitrite/getRepositoryClass?mappable=" + mappable) - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "INSERT") - .body("name", is("Leonard")); - - /* Insert Irma */ - RestAssured.given() - .contentType(ContentType.JSON) - .queryParam("mappable", mappable) - .body(irma) - .post("/nitrite/repositoryClass") - .then() - .statusCode(200) - .body("name", is("Irma")); - RestAssured.get("/nitrite/getRepositoryClass?mappable=" + mappable) - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "INSERT") - .body("name", is("Irma")); - - Employee updatedSheldon = null; - if (sheldon instanceof EmployeeSerializable) { - updatedSheldon = (EmployeeSerializable) sheldon.clone(); - } else { - updatedSheldon = (EmployeeMappable) sheldon.clone(); - } - updatedSheldon.setAddress("Moon"); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.update, "name", "Sheldon", - mappable ? null : (EmployeeSerializable) updatedSheldon, - mappable ? (EmployeeMappable) updatedSheldon : null)) - .queryParam("mappable", mappable) - .post("/nitrite/repositoryClassOperation") - .then() - .body("name", is("Sheldon"), - "address", is("Moon")); - - RestAssured.get("/nitrite/getRepositoryClass?mappable=" + mappable) - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "UPDATE") - .body("name", is("Sheldon"), - "address", is("Moon")); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.find, "address", (Object) "Moon", null, null)) - .queryParam("mappable", mappable) - .post("/nitrite/repositoryClassOperation") - .then() - .statusCode(200) - .body("size()", is(1), // After the update, there is 1 employee from the Moon - "[0].name", is("Sheldon")); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.findGt, "empId", (Object) 0, null, null)) - .queryParam("mappable", mappable) - .post("/nitrite/repositoryClassOperation") - .then() - .statusCode(200) - .body("size()", is(3));// there are 3 employees in total - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.delete, "address", "Moon", null, null)) - .queryParam("mappable", mappable) - .post("/nitrite/repositoryClassOperation") - .then() - .statusCode(204); - - RestAssured - .get("/nitrite/getRepositoryClass?mappable=" + mappable) - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "REMOVE") - .body("name", is("Sheldon"), - "address", is("Moon")); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.findGt, "empId", (Object) 0, null, null)) - .queryParam("mappable", mappable) - .post("/nitrite/repositoryClassOperation") - .then() - .statusCode(200) - .body("size()", is(2));// there are 2 employees after the deletion - - } - - @Test - public void collection() throws Exception { - /* Make sure there is no event there before we start inserting */ - RestAssured.get("/nitrite/collection") - .then() - .statusCode(204); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(Document.createDocument("key1", "value1")) - .post("/nitrite/collection") - .then() - .statusCode(200) - .body("key1", is("value1")); - RestAssured.get("/nitrite/collection") - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "INSERT") - .body("key1", is("value1")); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(Document.createDocument("key2", "value2")) - .post("/nitrite/collection") - .then() - .statusCode(200) - .body("key2", is("value2")); - RestAssured.get("/nitrite/collection") - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "INSERT") - .body("key2", is("value2")); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.insert, null, null, Document.createDocument("key1", "value_beforeUpdate"))) - .post("/nitrite/collectionOperation") - .then() - .statusCode(200) - .body("key1", is("value_beforeUpdate")); - RestAssured.get("/nitrite/collection") - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "INSERT") - .body("key1", is("value_beforeUpdate")); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.update, "key1", "value_beforeUpdate", - Document.createDocument("key1", "value_afterUpdate"))) - .post("/nitrite/collectionOperation") - .then() - .statusCode(200) - .body("key1", is("value_afterUpdate")); - RestAssured.get("/nitrite/collection") - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "UPDATE") - .body("key1", is("value_afterUpdate")); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.delete, "key1", "value1", (Document) null)) - .post("/nitrite/collectionOperation") - .then() - .statusCode(204); - RestAssured.get("/nitrite/collection") - .then() - .statusCode(200) - .header(NitriteConstants.CHANGE_TYPE, "REMOVE") - .body("key1", is("value1")); - - RestAssured.given() - .contentType(ContentType.JSON) - .body(new Operation(Operation.Type.find, "key1", (Object) "value_afterUpdate", null)) - .post("/nitrite/collectionOperation") - .then() - .statusCode(200) - .body("size()", is(1));// There is only 1 item with value1 - } - -} diff --git a/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteTestResource.java b/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteTestResource.java deleted file mode 100644 index 8bce63e3a4..0000000000 --- a/integration-tests/nitrite/src/test/java/org/apache/camel/quarkus/component/nitrite/it/NitriteTestResource.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.nitrite.it; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Map; - -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; -import org.apache.camel.util.CollectionHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class NitriteTestResource implements QuarkusTestResourceLifecycleManager { - private static final Logger LOGGER = LoggerFactory.getLogger(NitriteTestResource.class); - - private Path dbFile; - - @Override - public Map<String, String> start() { - - try { - String filePrefix = getClass().getSimpleName() + "-db-file-"; - LOGGER.debug("Creating temporary file for Nitrite db ({}*)", filePrefix); - dbFile = Files.createTempFile(filePrefix, ""); - - return CollectionHelper.mapOf(NitriteResource.PROPERTY_DB_FILE, dbFile.toString()); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - @Override - public void stop() { - try { - if (dbFile != null) { - Files.deleteIfExists(dbFile); - } - } catch (Exception e) { - // ignored - } - } -} diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 01e8f41d77..6125042c15 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -184,7 +184,6 @@ <module>mybatis</module> <module>nats</module> <module>netty</module> - <module>nitrite</module> <module>oaipmh</module> <module>oauth</module> <module>observability-services</module> diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index 32486c57b4..a208fa1a3e 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -2366,17 +2366,6 @@ <artifactId>camel-netty-http</artifactId> <version>${camel.version}</version> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-nitrite</artifactId> - <version>${camel.version}</version> - <exclusions> - <exclusion> - <groupId>javax.validation</groupId> - <artifactId>validation-api</artifactId> - </exclusion> - </exclusions> - </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-oaipmh</artifactId> @@ -5711,16 +5700,6 @@ <artifactId>camel-quarkus-netty-http-deployment</artifactId> <version>${camel-quarkus.version}</version> </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite</artifactId> - <version>${camel-quarkus.version}</version> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite-deployment</artifactId> - <version>${camel-quarkus.version}</version> - </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-oaipmh</artifactId> diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml b/poms/bom/src/main/generated/flattened-full-pom.xml index 966e120af6..d721cad486 100644 --- a/poms/bom/src/main/generated/flattened-full-pom.xml +++ b/poms/bom/src/main/generated/flattened-full-pom.xml @@ -2279,17 +2279,6 @@ <artifactId>camel-netty-http</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <version>4.19.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> </dependency> - <dependency> - <groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <artifactId>camel-nitrite</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <version>4.19.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <exclusions> - <exclusion> - <groupId>javax.validation</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <artifactId>validation-api</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - </exclusion> - </exclusions> - </dependency> <dependency> <groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <artifactId>camel-oaipmh</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> @@ -5596,16 +5585,6 @@ <artifactId>camel-quarkus-netty-http-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <version>3.33.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <artifactId>camel-quarkus-nitrite</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <version>3.33.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <artifactId>camel-quarkus-nitrite-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <version>3.33.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <artifactId>camel-quarkus-oaipmh</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml b/poms/bom/src/main/generated/flattened-reduced-pom.xml index 8352d220e5..ee484fceea 100644 --- a/poms/bom/src/main/generated/flattened-reduced-pom.xml +++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml @@ -2274,17 +2274,6 @@ <artifactId>camel-netty-http</artifactId> <version>4.19.0-SNAPSHOT</version> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-nitrite</artifactId> - <version>4.19.0-SNAPSHOT</version> - <exclusions> - <exclusion> - <groupId>javax.validation</groupId> - <artifactId>validation-api</artifactId> - </exclusion> - </exclusions> - </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-oaipmh</artifactId> @@ -5575,16 +5564,6 @@ <artifactId>camel-quarkus-netty-http-deployment</artifactId> <version>3.33.0-SNAPSHOT</version> </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite</artifactId> - <version>3.33.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-nitrite-deployment</artifactId> - <version>3.33.0-SNAPSHOT</version> - </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-oaipmh</artifactId> diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml index 02edb59d69..74a94c4d6c 100644 --- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml +++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml @@ -2274,17 +2274,6 @@ <artifactId>camel-netty-http</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <version>4.19.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> </dependency> - <dependency> - <groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <artifactId>camel-nitrite</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <version>4.19.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <exclusions> - <exclusion> - <groupId>javax.validation</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <artifactId>validation-api</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - </exclusion> - </exclusions> - </dependency> <dependency> <groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <artifactId>camel-oaipmh</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> @@ -5575,16 +5564,6 @@ <artifactId>camel-quarkus-netty-http-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <version>3.33.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <artifactId>camel-quarkus-nitrite</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <version>3.33.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <artifactId>camel-quarkus-nitrite-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - <version>3.33.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> - </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <artifactId>camel-quarkus-oaipmh</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml index 0203c20f52..64d569be84 100644 --- a/tooling/scripts/test-categories.yaml +++ b/tooling/scripts/test-categories.yaml @@ -247,6 +247,5 @@ group-13: - sap-netweaver - servicenow - slack - - nitrite - twilio - pgevent
