This is an automated email from the ASF dual-hosted git repository. github-bot pushed a commit to branch camel-main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit df295852325ad43e344a84c6d805dbc67460e19b Author: James Netherton <jamesnether...@gmail.com> AuthorDate: Wed Feb 9 11:13:37 2022 +0000 Upgrade Camel to 3.16.0 --- docs/antora.yml | 6 +- .../ROOT/pages/reference/extensions/yaml-dsl.adoc | 6 -- .../it/health/CustomHealthCheckRepository.java | 17 ------ .../microprofile/it/health/FailingHealthCheck.java | 2 +- .../it/health/FailureThresholdHealthCheck.java | 51 ---------------- .../it/health/MicroProfileHealthResource.java | 17 +----- .../src/main/resources/application.properties | 7 +-- .../it/health/MicroProfileHealthTest.java | 67 ---------------------- pom.xml | 6 +- 9 files changed, 9 insertions(+), 170 deletions(-) diff --git a/docs/antora.yml b/docs/antora.yml index 1413755..0d85853 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -29,11 +29,11 @@ asciidoc: min-maven-version: 3.8.1 # replace ${min-maven-version} target-maven-version: 3.8.4 # replace ${target-maven-version} - camel-version: 3.15.0 # replace ${camel.version} - camel-docs-version: 3.15.x # replace ${camel.docs.components.version} + camel-version: 3.16.0-SNAPSHOT # replace ${camel.version} + camel-docs-version: 3.16.x # replace ${camel.docs.components.version} quarkus-version: 2.7.1.Final # replace ${quarkus.version} graalvm-version: 21.3.1 # replace ${graalvm.version} graalvm-docs-version: 21.3 # attributes used in xrefs to other Antora components - cq-camel-components: 3.15.x@components # replace ${camel.docs.components.xref} + cq-camel-components: 3.16.x@components # replace ${camel.docs.components.xref} quarkus-examples-version: latest diff --git a/docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc b/docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc index bdde5d3..26484a9 100644 --- a/docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc +++ b/docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc @@ -16,12 +16,6 @@ An YAML stack for parsing YAML route definitions -== What's inside - -* xref:{cq-camel-components}:others:yaml-dsl.adoc[YAML DSL] - -Please refer to the above link for usage and configuration details. - == Maven coordinates https://code.quarkus.io/?extension-search=camel-quarkus-yaml-dsl[Create a new project with this extension on code.quarkus.io, window="_blank"] diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java index c54665d..2d31330 100644 --- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java +++ b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java @@ -16,12 +16,10 @@ */ package org.apache.camel.quarkus.component.microprofile.it.health; -import java.util.Collections; import java.util.Map; import java.util.stream.Stream; import org.apache.camel.health.HealthCheck; -import org.apache.camel.health.HealthCheckConfiguration; import org.apache.camel.health.HealthCheckRepository; import org.apache.camel.health.HealthCheckResultBuilder; import org.apache.camel.impl.health.AbstractHealthCheck; @@ -44,21 +42,6 @@ public class CustomHealthCheckRepository implements HealthCheckRepository { } @Override - public void setConfigurations(Map<String, HealthCheckConfiguration> configurations) { - // Noop - } - - @Override - public Map<String, HealthCheckConfiguration> getConfigurations() { - return Collections.emptyMap(); - } - - @Override - public void addConfiguration(String id, HealthCheckConfiguration configuration) { - // Noop - } - - @Override public Stream<HealthCheck> stream() { return Stream.of(check); } diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java index 2d56d54..b278052 100644 --- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java +++ b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java @@ -25,7 +25,7 @@ public class FailingHealthCheck extends AbstractHealthCheck { public FailingHealthCheck() { super("failing-check"); - getConfiguration().setEnabled(false); + setEnabled(false); } @Override diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailureThresholdHealthCheck.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailureThresholdHealthCheck.java deleted file mode 100644 index 6fbcb6e..0000000 --- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailureThresholdHealthCheck.java +++ /dev/null @@ -1,51 +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.microprofile.it.health; - -import java.util.Map; - -import org.apache.camel.health.HealthCheckResultBuilder; -import org.apache.camel.impl.health.AbstractHealthCheck; - -public final class FailureThresholdHealthCheck extends AbstractHealthCheck { - - private boolean returnStatusUp = false; - - public FailureThresholdHealthCheck() { - super("failure-threshold", "failure-threshold"); - getConfiguration().setEnabled(false); - getConfiguration().setFailureThreshold(2); - getConfiguration().setInterval(500); - } - - @Override - protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> options) { - if (isReturnStatusUp()) { - builder.up(); - } else { - builder.down(); - } - } - - public void setReturnStatusUp(boolean returnStatusUp) { - this.returnStatusUp = returnStatusUp; - } - - public boolean isReturnStatusUp() { - return returnStatusUp; - } -} diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java index f5392e6..1e2e297 100644 --- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java +++ b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java @@ -24,7 +24,6 @@ import javax.ws.rs.PathParam; import javax.ws.rs.QueryParam; import org.apache.camel.CamelContext; -import org.apache.camel.health.HealthCheck; import org.apache.camel.health.HealthCheckRegistry; @Path("/microprofile-health") @@ -52,7 +51,7 @@ public class MicroProfileHealthResource { @QueryParam("healthCheckEnabled") boolean isHealthCheckEnabled) { HealthCheckRegistry registry = camelContext.getExtension(HealthCheckRegistry.class); registry.getCheck(healthCheckId).ifPresent(healthCheck -> { - healthCheck.getConfiguration().setEnabled(isHealthCheckEnabled); + healthCheck.setEnabled(isHealthCheckEnabled); if (isHealthCheckEnabled) { registry.register(healthCheck); } else { @@ -60,18 +59,4 @@ public class MicroProfileHealthResource { } }); } - - @Path("/{healthCheckId}/return/status") - @POST - public void modifyHealthCheckStatus( - @PathParam("healthCheckId") String healthCheckId, - @QueryParam("returnStatusUp") boolean isReturnStatusUp) { - HealthCheck healthCheck = camelContext - .getExtension(HealthCheckRegistry.class) - .getCheck(healthCheckId) - .get(); - - FailureThresholdHealthCheck failureThresholdHealthCheck = (FailureThresholdHealthCheck) healthCheck; - failureThresholdHealthCheck.setReturnStatusUp(isReturnStatusUp); - } } diff --git a/integration-tests/microprofile/src/main/resources/application.properties b/integration-tests/microprofile/src/main/resources/application.properties index 4537e97..9b94638 100644 --- a/integration-tests/microprofile/src/main/resources/application.properties +++ b/integration-tests/microprofile/src/main/resources/application.properties @@ -26,9 +26,4 @@ quarkus.camel.metrics.enable-message-history = true camel.context.name = quarkus-camel-example # Prevent unwanted routes appearing in the health check output -camel.health.config[disabledHealthRoute].parent=routes -camel.health.config[disabledHealthRoute].enabled=false - -camel.health.config[checkIntervalThreshold].parent = routes -camel.health.config[checkIntervalThreshold].interval = 100 -camel.health.config[checkIntervalThreshold].failure-threshold = 2 +camel.health.exclude-pattern = disabledHealthRoute diff --git a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java index db79af1..4c24962 100644 --- a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java +++ b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java @@ -16,15 +16,10 @@ */ package org.apache.camel.quarkus.component.microprofile.it.health; -import java.util.List; -import java.util.concurrent.TimeUnit; - import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; -import io.restassured.path.json.JsonPath; import org.apache.camel.ServiceStatus; -import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import static org.hamcrest.Matchers.contains; @@ -165,66 +160,4 @@ class MicroProfileHealthTest { .statusCode(204); } } - - @Test - public void testFailureThreshold() { - try { - RestAssured.given() - .queryParam("healthCheckEnabled", "true") - .post("/microprofile-health/failure-threshold") - .then() - .statusCode(204); - - // Configured failure threshold and interval should allow the initial health state be UP - RestAssured.when().get("/q/health").then() - .contentType(ContentType.JSON) - .header("Content-Type", containsString("charset=UTF-8")) - .body("status", is("UP"), - "checks.findAll { it.name == 'failure-threshold' }.status.unique()", contains("UP")); - - // Poll the health endpoint until the threshold / interval is exceeded and the health state transitions to DOWN - Awaitility.await().atMost(10, TimeUnit.SECONDS).pollDelay(50, TimeUnit.MILLISECONDS).until(() -> { - JsonPath result = RestAssured.when().get("/q/health").then() - .contentType(ContentType.JSON) - .header("Content-Type", containsString("charset=UTF-8")) - .extract() - .jsonPath(); - - String status = result.getString("status"); - List<String> routeStatus = result.getList("checks.findAll { it.name == 'failure-threshold' }.status.unique()"); - return status.equals("DOWN") && routeStatus.contains("DOWN"); - }); - - RestAssured.given() - .queryParam("returnStatusUp", true) - .post("/microprofile-health/failure-threshold/return/status") - .then() - .statusCode(204); - - // Try again with a poll delay > the failure interval and wait for the health state to transition to UP - Awaitility.await().atMost(10, TimeUnit.SECONDS).pollDelay(50, TimeUnit.MILLISECONDS).until(() -> { - JsonPath result = RestAssured.when().get("/q/health").then() - .contentType(ContentType.JSON) - .header("Content-Type", containsString("charset=UTF-8")) - .extract() - .jsonPath(); - - String status = result.getString("status"); - List<String> routeStatus = result.getList("checks.findAll { it.name == 'failure-threshold' }.status.unique()"); - return status.equals("UP") && routeStatus.contains("UP"); - }); - } finally { - RestAssured.given() - .queryParam("returnStatusUp", false) - .post("/microprofile-health/failure-threshold/return/status") - .then() - .statusCode(204); - - RestAssured.given() - .queryParam("healthCheckEnabled", "false") - .post("/microprofile-health/failure-threshold") - .then() - .statusCode(204); - } - } } diff --git a/pom.xml b/pom.xml index 20b39be..a167d83 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ <parent> <groupId>org.apache.camel</groupId> <artifactId>camel-dependencies</artifactId> - <version>3.15.0</version> + <version>3.16.0-SNAPSHOT</version> </parent> <groupId>org.apache.camel.quarkus</groupId> @@ -39,8 +39,8 @@ <properties> <!-- Primary dependencies - maintained manually --> - <camel.major.minor>3.15</camel.major.minor> <!-- run after each change: cd docs && mvnd validate --> - <camel.version>${camel.major.minor}.0</camel.version> + <camel.major.minor>3.16</camel.major.minor> <!-- run after each change: cd docs && mvnd validate --> + <camel.version>${camel.major.minor}.0-SNAPSHOT</camel.version> <camel.docs.components.version>${camel.major.minor}.x</camel.docs.components.version><!-- the version in Camel's docs/components/antora.yml --> <camel.docs.components.xref>${camel.docs.components.version}@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml --> <camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable camel branch on which our Antora docs depends -->