diff --git a/docs/modules/ROOT/examples/components/elasticsearch-rest-client.yml b/docs/modules/ROOT/examples/components/elasticsearch-rest-client.yml index bb26f5144d4e..b8975788c3b0 100644 --- a/docs/modules/ROOT/examples/components/elasticsearch-rest-client.yml +++ b/docs/modules/ROOT/examples/components/elasticsearch-rest-client.yml @@ -2,11 +2,11 @@ # This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page cqArtifactId: camel-quarkus-elasticsearch-rest-client cqArtifactIdBase: elasticsearch-rest-client -cqNativeSupported: false -cqStatus: Preview +cqNativeSupported: true +cqStatus: Stable cqDeprecated: false cqJvmSince: 3.8.0 -cqNativeSince: n/a +cqNativeSince: 3.12.0 cqCamelPartName: elasticsearch-rest-client cqCamelPartTitle: Elasticsearch Low level Rest Client cqCamelPartDescription: Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client). diff --git a/docs/modules/ROOT/pages/reference/extensions/elasticsearch-rest-client.adoc b/docs/modules/ROOT/pages/reference/extensions/elasticsearch-rest-client.adoc index b8a1eb03c0aa..fc06190f3b7a 100644 --- a/docs/modules/ROOT/pages/reference/extensions/elasticsearch-rest-client.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/elasticsearch-rest-client.adoc @@ -4,17 +4,17 @@ = Elasticsearch Low level Rest Client :linkattrs: :cq-artifact-id: camel-quarkus-elasticsearch-rest-client -:cq-native-supported: false -:cq-status: Preview -:cq-status-deprecation: Preview +:cq-native-supported: true +:cq-status: Stable +:cq-status-deprecation: Stable :cq-description: Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client). :cq-deprecated: false :cq-jvm-since: 3.8.0 -:cq-native-since: n/a +:cq-native-since: 3.12.0 ifeval::[{doc-show-badges} == true] [.badges] -[.badge-key]##JVM since##[.badge-supported]##3.8.0## [.badge-key]##Native##[.badge-unsupported]##unsupported## +[.badge-key]##JVM since##[.badge-supported]##3.8.0## [.badge-key]##Native since##[.badge-supported]##3.12.0## endif::[] Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client). @@ -29,6 +29,10 @@ Please refer to the above link for usage and configuration details. [id="extensions-elasticsearch-rest-client-maven-coordinates"] == Maven coordinates +https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-elasticsearch-rest-client[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"] + +Or add the coordinates to your existing project: + [source,xml] ---- diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml index 5f2471a6fcef..cfdf76b6c04c 100644 --- a/extensions-jvm/pom.xml +++ b/extensions-jvm/pom.xml @@ -60,7 +60,6 @@ dsl-modeline ehcache elasticsearch - elasticsearch-rest-client etcd3 fastjson flink diff --git a/extensions-jvm/elasticsearch-rest-client/deployment/pom.xml b/extensions/elasticsearch-rest-client/deployment/pom.xml similarity index 100% rename from extensions-jvm/elasticsearch-rest-client/deployment/pom.xml rename to extensions/elasticsearch-rest-client/deployment/pom.xml diff --git a/extensions-jvm/elasticsearch-rest-client/deployment/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/deployment/ElasticsearchRestClientProcessor.java b/extensions/elasticsearch-rest-client/deployment/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/deployment/ElasticsearchRestClientProcessor.java similarity index 61% rename from extensions-jvm/elasticsearch-rest-client/deployment/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/deployment/ElasticsearchRestClientProcessor.java rename to extensions/elasticsearch-rest-client/deployment/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/deployment/ElasticsearchRestClientProcessor.java index ef01d961963e..480f4c387f73 100644 --- a/extensions-jvm/elasticsearch-rest-client/deployment/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/deployment/ElasticsearchRestClientProcessor.java +++ b/extensions/elasticsearch-rest-client/deployment/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/deployment/ElasticsearchRestClientProcessor.java @@ -17,30 +17,13 @@ package org.apache.camel.quarkus.component.elasticsearch.rest.client.deployment; import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.annotations.ExecutionTime; -import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild; -import org.apache.camel.quarkus.core.JvmOnlyRecorder; -import org.jboss.logging.Logger; class ElasticsearchRestClientProcessor { - - private static final Logger LOG = Logger.getLogger(ElasticsearchRestClientProcessor.class); private static final String FEATURE = "camel-elasticsearch-rest-client"; @BuildStep FeatureBuildItem feature() { return new FeatureBuildItem(FEATURE); } - - /** - * Remove this once this extension starts supporting the native mode. - */ - @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) - @Record(value = ExecutionTime.RUNTIME_INIT) - void warnJvmInNative(JvmOnlyRecorder recorder) { - JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time - recorder.warnJvmInNative(FEATURE); // warn at runtime - } } diff --git a/extensions-jvm/elasticsearch-rest-client/pom.xml b/extensions/elasticsearch-rest-client/pom.xml similarity index 96% rename from extensions-jvm/elasticsearch-rest-client/pom.xml rename to extensions/elasticsearch-rest-client/pom.xml index 904080cef7ea..3838b1e3d706 100644 --- a/extensions-jvm/elasticsearch-rest-client/pom.xml +++ b/extensions/elasticsearch-rest-client/pom.xml @@ -21,7 +21,7 @@ 4.0.0 org.apache.camel.quarkus - camel-quarkus-extensions-jvm + camel-quarkus-extensions 3.12.0-SNAPSHOT ../pom.xml diff --git a/extensions-jvm/elasticsearch-rest-client/runtime/pom.xml b/extensions/elasticsearch-rest-client/runtime/pom.xml similarity index 98% rename from extensions-jvm/elasticsearch-rest-client/runtime/pom.xml rename to extensions/elasticsearch-rest-client/runtime/pom.xml index 771e9880b4cb..aaa7c2a99b80 100644 --- a/extensions-jvm/elasticsearch-rest-client/runtime/pom.xml +++ b/extensions/elasticsearch-rest-client/runtime/pom.xml @@ -32,6 +32,7 @@ 3.8.0 + 3.12.0 diff --git a/extensions-jvm/elasticsearch-rest-client/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/elasticsearch-rest-client/runtime/src/main/resources/META-INF/quarkus-extension.yaml similarity index 97% rename from extensions-jvm/elasticsearch-rest-client/runtime/src/main/resources/META-INF/quarkus-extension.yaml rename to extensions/elasticsearch-rest-client/runtime/src/main/resources/META-INF/quarkus-extension.yaml index e26a769ed53a..9519f74c10b9 100644 --- a/extensions-jvm/elasticsearch-rest-client/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/elasticsearch-rest-client/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -25,9 +25,8 @@ name: "Camel Elasticsearch Low level Rest Client" description: "Perform queries and other operations on Elasticsearch or OpenSearch (uses low-level client)" metadata: icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg" - unlisted: true guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/elasticsearch-rest-client.html" categories: - "integration" status: - - "preview" + - "stable" diff --git a/extensions/pom.xml b/extensions/pom.xml index 12c0c59b9977..e6f4e545f40f 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -97,6 +97,7 @@ direct disruptor dropbox + elasticsearch-rest-client exec fhir file diff --git a/integration-tests-jvm/pom.xml b/integration-tests-jvm/pom.xml index 259bb5a6d124..6815865497df 100644 --- a/integration-tests-jvm/pom.xml +++ b/integration-tests-jvm/pom.xml @@ -59,7 +59,6 @@ dsl-modeline ehcache elasticsearch - elasticsearch-rest-client etcd3 fastjson flink diff --git a/integration-tests-jvm/elasticsearch-rest-client/pom.xml b/integration-tests/elasticsearch-rest-client/pom.xml similarity index 82% rename from integration-tests-jvm/elasticsearch-rest-client/pom.xml rename to integration-tests/elasticsearch-rest-client/pom.xml index 366830148b12..e84b1b22c0f2 100644 --- a/integration-tests-jvm/elasticsearch-rest-client/pom.xml +++ b/integration-tests/elasticsearch-rest-client/pom.xml @@ -142,5 +142,43 @@ + + native + + + native + + + + true + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify + + + + + + + + + skip-testcontainers-tests + + + skip-testcontainers-tests + + + + true + + diff --git a/integration-tests-jvm/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/Document.java b/integration-tests/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/Document.java similarity index 100% rename from integration-tests-jvm/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/Document.java rename to integration-tests/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/Document.java diff --git a/integration-tests-jvm/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientResource.java b/integration-tests/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientResource.java similarity index 100% rename from integration-tests-jvm/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientResource.java rename to integration-tests/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientResource.java diff --git a/integration-tests-jvm/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientRoutes.java b/integration-tests/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientRoutes.java similarity index 100% rename from integration-tests-jvm/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientRoutes.java rename to integration-tests/elasticsearch-rest-client/src/main/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientRoutes.java diff --git a/integration-tests-jvm/elasticsearch-rest-client/src/main/resources/application.properties b/integration-tests/elasticsearch-rest-client/src/main/resources/application.properties similarity index 100% rename from integration-tests-jvm/elasticsearch-rest-client/src/main/resources/application.properties rename to integration-tests/elasticsearch-rest-client/src/main/resources/application.properties diff --git a/integration-tests/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientIT.java b/integration-tests/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientIT.java new file mode 100644 index 000000000000..fa513234eb01 --- /dev/null +++ b/integration-tests/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientIT.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.elasticsearch.rest.client.it; + +import io.quarkus.test.junit.QuarkusIntegrationTest; + +@QuarkusIntegrationTest +class ElasticsearchRestClientIT extends ElasticsearchRestClientTest { + +} diff --git a/integration-tests-jvm/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientTest.java b/integration-tests/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientTest.java similarity index 100% rename from integration-tests-jvm/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientTest.java rename to integration-tests/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestClientTest.java diff --git a/integration-tests-jvm/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestTestResource.java b/integration-tests/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestTestResource.java similarity index 87% rename from integration-tests-jvm/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestTestResource.java rename to integration-tests/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestTestResource.java index 01d25c83b034..7bc299fba5f3 100644 --- a/integration-tests-jvm/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestTestResource.java +++ b/integration-tests/elasticsearch-rest-client/src/test/java/org/apache/camel/quarkus/component/elasticsearch/rest/client/it/ElasticsearchRestTestResource.java @@ -29,12 +29,17 @@ import java.util.Base64; import java.util.Map; +import com.github.dockerjava.api.model.ExposedPort; +import com.github.dockerjava.api.model.HostConfig; +import com.github.dockerjava.api.model.Ports; import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; import org.apache.camel.util.CollectionHelper; import org.eclipse.microprofile.config.ConfigProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.testcontainers.DockerClientFactory; import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.Network; import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.images.builder.Transferable; @@ -58,10 +63,13 @@ public Map start() { exportCertificateCAForClient(); try { + Network elasticSearchNetwork = Network.newNetwork(); + container = new GenericContainer<>(ELASTICSEARCH_IMAGE) .withExposedPorts(ELASTICSEARCH_PORT) .withLogConsumer(new Slf4jLogConsumer(LOGGER)) .withEnv("discovery.type", "single-node") + .withEnv("http.publish_host", DockerClientFactory.instance().dockerHostIpAddress()) .withEnv("xpack.security.enabled", "true") .withEnv("xpack.security.transport.ssl.enabled", "true") .withEnv("xpack.security.transport.ssl.verification_mode", "certificate") @@ -78,6 +86,14 @@ public Map start() { .withCopyToContainer( Transferable.of(Files.readAllBytes(Paths.get("target/certs/elasticsearch-truststore.p12"))), "/usr/share/elasticsearch/config/certs/elasticsearch-truststore.p12") + .withCreateContainerCmdModifier(createContainerCmd -> { + Ports portBindings = new Ports(); + portBindings.bind(ExposedPort.tcp(ELASTICSEARCH_PORT), Ports.Binding.bindPort(ELASTICSEARCH_PORT)); + HostConfig hostConfig = HostConfig.newHostConfig() + .withPortBindings(portBindings) + .withNetworkMode(elasticSearchNetwork.getId()); + createContainerCmd.withHostConfig(hostConfig); + }) .waitingFor(Wait.forListeningPort()); container.start(); diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index d42f9962a3e1..e49211e3e79b 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -88,6 +88,7 @@ digitalocean disruptor dropbox + elasticsearch-rest-client exec fhir file diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml index 34f7eff50d64..8ffe62fd8b19 100644 --- a/tooling/scripts/test-categories.yaml +++ b/tooling/scripts/test-categories.yaml @@ -73,6 +73,7 @@ group-04: - debezium - cassandraql - couchdb + - elasticsearch-rest-client - influxdb - jms-qpid-amqp-client - jpa