This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new fb80264704 Deprecate Jolokia /q/jolokia management endpoint
fb80264704 is described below

commit fb8026470444f07a1b28753651a105da0c95d415
Author: James Netherton <jamesnether...@gmail.com>
AuthorDate: Tue May 20 13:50:59 2025 +0100

    Deprecate Jolokia /q/jolokia management endpoint
    
    Fixes #7387
---
 docs/modules/ROOT/pages/migration-guide/3.23.0.adoc      | 16 ++++++++++++++++
 docs/modules/ROOT/pages/migration-guide/index.adoc       |  1 +
 .../modules/ROOT/pages/reference/extensions/jolokia.adoc | 12 +++---------
 .../quarkus/jolokia/deployment/JolokiaProcessor.java     |  2 ++
 .../quarkus/jolokia/JolokiaCustomContextPathTest.java    |  1 +
 .../apache/camel/quarkus/jolokia/JolokiaEnabledTest.java |  1 +
 extensions/jolokia/runtime/src/main/doc/usage.adoc       |  8 --------
 .../apache/camel/quarkus/jolokia/JolokiaRecorder.java    |  6 +++++-
 .../quarkus/jolokia/config/JolokiaBuildTimeConfig.java   |  5 ++++-
 .../jolokia/src/main/resources/application.properties    |  1 +
 10 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/docs/modules/ROOT/pages/migration-guide/3.23.0.adoc 
b/docs/modules/ROOT/pages/migration-guide/3.23.0.adoc
new file mode 100644
index 0000000000..99bc82cb23
--- /dev/null
+++ b/docs/modules/ROOT/pages/migration-guide/3.23.0.adoc
@@ -0,0 +1,16 @@
+= Camel Quarkus 3.23.0 Migration Guide
+
+The following guide outlines how to adapt your code to changes that were made 
in Camel Quarkus 3.23.0.
+
+== `camel-quarkus-jolokia` `register-management-endpoint` default changed to 
`false`
+
+When using `camel-quarkus-jolokia`, the `/q/jolokia` Quarkus management 
endpoint is no longer registered by default. It has been deprecated for removal 
in a future release.
+
+If you need to restore the previous behavior and expose `/q/jolokia`, then you 
can add the following to `application.properties`.
+
+[source]
+----
+quarkus.camel.jolokia.register-management-endpoint=true
+----
+
+However, as mentioned above, this option will eventually be removed.
diff --git a/docs/modules/ROOT/pages/migration-guide/index.adoc 
b/docs/modules/ROOT/pages/migration-guide/index.adoc
index afd30c3d91..6fd680d137 100644
--- a/docs/modules/ROOT/pages/migration-guide/index.adoc
+++ b/docs/modules/ROOT/pages/migration-guide/index.adoc
@@ -4,6 +4,7 @@ We do frequent releases, a release almost every month, and even 
though we strive
 
 Listed here are guides on how to migrate between major versions and anything 
of significance to watch for when upgrading from minor versions.
 
+* xref:migration-guide/3.23.0.adoc[Camel Quarkus 3.22.x to Camel Quarkus 
3.23.0 migration guide]
 * xref:migration-guide/3.18.0.adoc[Camel Quarkus 3.17.x to Camel Quarkus 
3.18.0 migration guide]
 * xref:migration-guide/3.17.0.adoc[Camel Quarkus 3.16.x to Camel Quarkus 
3.17.0 migration guide]
 * xref:migration-guide/3.15.0.adoc[Camel Quarkus 3.14.x to Camel Quarkus 
3.15.0 migration guide]
diff --git a/docs/modules/ROOT/pages/reference/extensions/jolokia.adoc 
b/docs/modules/ROOT/pages/reference/extensions/jolokia.adoc
index c294bce338..ec7b9593bb 100644
--- a/docs/modules/ROOT/pages/reference/extensions/jolokia.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/jolokia.adoc
@@ -47,17 +47,9 @@ This extension adds https://jolokia.org/[Jolokia] support to 
your application.
 In prod mode, Jolokia is accessible at the following URLs.
 
 * http://0.0.0.0:8778/jolokia/
-* http://0.0.0.0:8080/q/jolokia
 
 In dev and test modes Jolokia is bound only to `localhost`.
 
-To disable exposing Jolokia via the Quarkus management interface at 
`/q/jolokia`, add the following configuration to `application.properties`.
-
-[source]
-----
-quarkus.camel.jolokia.register-management-endpoint=false
-----
-
 If you want to disable Jolokia entirely, then add the following configuration 
to `application.properties`.
 
 [source]
@@ -204,8 +196,10 @@ When enabled this activates a management endpoint which 
will be accessible on a
 If the management interface is enabled, the value will be resolved as a path 
relative to
 `${quarkus.management.root-path}/${quarkus.camel.jolokia.server.path}`. Note 
that for this feature to work you must
 have `quarkus-vertx-http` on the application classpath.
+
+**This option is deprecated and will be removed in a future release**.
 | `boolean`
-| `true`
+| `false`
 
 a|icon:lock[title=Fixed at build time] 
[[quarkus-camel-jolokia-camel-restrictor-allowed-mbean-domains]]`link:#quarkus-camel-jolokia-camel-restrictor-allowed-mbean-domains[quarkus.camel.jolokia.camel-restrictor-allowed-mbean-domains]`
 
diff --git 
a/extensions/jolokia/deployment/src/main/java/org/apache/camel/quarkus/jolokia/deployment/JolokiaProcessor.java
 
b/extensions/jolokia/deployment/src/main/java/org/apache/camel/quarkus/jolokia/deployment/JolokiaProcessor.java
index fe01ef89c8..d1ba81e598 100644
--- 
a/extensions/jolokia/deployment/src/main/java/org/apache/camel/quarkus/jolokia/deployment/JolokiaProcessor.java
+++ 
b/extensions/jolokia/deployment/src/main/java/org/apache/camel/quarkus/jolokia/deployment/JolokiaProcessor.java
@@ -153,6 +153,8 @@ public class JolokiaProcessor {
             JolokiaRecorder recorder) {
 
         if (capabilities.isPresent(Capability.VERTX_HTTP)) {
+            recorder.warnOnDeprecatedRegisterManagementEndpoint();
+
             String jolokiaEndpointPath = 
nonApplicationRootPathBuildItem.resolvePath(buildTimeConfig.path());
             routes.produce(nonApplicationRootPathBuildItem.routeBuilder()
                     .management()
diff --git 
a/extensions/jolokia/deployment/src/test/java/org/apache/camel/quarkus/jolokia/JolokiaCustomContextPathTest.java
 
b/extensions/jolokia/deployment/src/test/java/org/apache/camel/quarkus/jolokia/JolokiaCustomContextPathTest.java
index 6965c44c95..fd3f01c7eb 100644
--- 
a/extensions/jolokia/deployment/src/test/java/org/apache/camel/quarkus/jolokia/JolokiaCustomContextPathTest.java
+++ 
b/extensions/jolokia/deployment/src/test/java/org/apache/camel/quarkus/jolokia/JolokiaCustomContextPathTest.java
@@ -25,6 +25,7 @@ class JolokiaCustomContextPathTest {
     @RegisterExtension
     static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
             .withEmptyApplication()
+            
.overrideConfigKey("quarkus.camel.jolokia.register-management-endpoint", "true")
             .overrideConfigKey("quarkus.camel.jolokia.path", "test");
 
     @Test
diff --git 
a/extensions/jolokia/deployment/src/test/java/org/apache/camel/quarkus/jolokia/JolokiaEnabledTest.java
 
b/extensions/jolokia/deployment/src/test/java/org/apache/camel/quarkus/jolokia/JolokiaEnabledTest.java
index cdfe1122de..90031ef464 100644
--- 
a/extensions/jolokia/deployment/src/test/java/org/apache/camel/quarkus/jolokia/JolokiaEnabledTest.java
+++ 
b/extensions/jolokia/deployment/src/test/java/org/apache/camel/quarkus/jolokia/JolokiaEnabledTest.java
@@ -37,6 +37,7 @@ import static org.junit.jupiter.api.Assertions.fail;
 class JolokiaEnabledTest {
     @RegisterExtension
     static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
+            
.overrideConfigKey("quarkus.camel.jolokia.register-management-endpoint", "true")
             .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
                     .addClass(Routes.class));
 
diff --git a/extensions/jolokia/runtime/src/main/doc/usage.adoc 
b/extensions/jolokia/runtime/src/main/doc/usage.adoc
index fae99e7a72..1299ab8e0a 100644
--- a/extensions/jolokia/runtime/src/main/doc/usage.adoc
+++ b/extensions/jolokia/runtime/src/main/doc/usage.adoc
@@ -5,17 +5,9 @@ This extension adds https://jolokia.org/[Jolokia] support to 
your application.
 In prod mode, Jolokia is accessible at the following URLs.
 
 * http://0.0.0.0:8778/jolokia/
-* http://0.0.0.0:8080/q/jolokia
 
 In dev and test modes Jolokia is bound only to `localhost`.
 
-To disable exposing Jolokia via the Quarkus management interface at 
`/q/jolokia`, add the following configuration to `application.properties`.
-
-[source]
-----
-quarkus.camel.jolokia.register-management-endpoint=false
-----
-
 If you want to disable Jolokia entirely, then add the following configuration 
to `application.properties`.
 
 [source]
diff --git 
a/extensions/jolokia/runtime/src/main/java/org/apache/camel/quarkus/jolokia/JolokiaRecorder.java
 
b/extensions/jolokia/runtime/src/main/java/org/apache/camel/quarkus/jolokia/JolokiaRecorder.java
index 081a6aa422..ad26fda3f7 100644
--- 
a/extensions/jolokia/runtime/src/main/java/org/apache/camel/quarkus/jolokia/JolokiaRecorder.java
+++ 
b/extensions/jolokia/runtime/src/main/java/org/apache/camel/quarkus/jolokia/JolokiaRecorder.java
@@ -53,7 +53,7 @@ import static io.smallrye.common.os.Linux.isWSL;
 public class JolokiaRecorder {
     private static final String ALL_INTERFACES = "0.0.0.0";
     private static final String LOCALHOST = "localhost";
-    private static final Logger LOG = 
Logger.getLogger(JolokiaRequestRedirectHandler.class);
+    private static final Logger LOG = Logger.getLogger(JolokiaRecorder.class);
 
     public Consumer<Route> route(Handler<RoutingContext> bodyHandler) {
         return new Consumer<Route>() {
@@ -181,6 +181,10 @@ public class JolokiaRecorder {
         return new JolokiaRequestRedirectHandler(uri.normalize(), 
jolokiaEndpointPath);
     }
 
+    public void warnOnDeprecatedRegisterManagementEndpoint() {
+        LOG.warn("quarkus.camel.jolokia.register-management-endpoint is 
deprecated and will be removed in a future release");
+    }
+
     static String resolveHost(InetAddress address) {
         String host;
         if (address == null) {
diff --git 
a/extensions/jolokia/runtime/src/main/java/org/apache/camel/quarkus/jolokia/config/JolokiaBuildTimeConfig.java
 
b/extensions/jolokia/runtime/src/main/java/org/apache/camel/quarkus/jolokia/config/JolokiaBuildTimeConfig.java
index c0d0141dcf..f4ed54dd52 100644
--- 
a/extensions/jolokia/runtime/src/main/java/org/apache/camel/quarkus/jolokia/config/JolokiaBuildTimeConfig.java
+++ 
b/extensions/jolokia/runtime/src/main/java/org/apache/camel/quarkus/jolokia/config/JolokiaBuildTimeConfig.java
@@ -45,8 +45,11 @@ public interface JolokiaBuildTimeConfig {
      * If the management interface is enabled, the value will be resolved as a 
path relative to
      * `${quarkus.management.root-path}/${quarkus.camel.jolokia.server.path}`. 
Note that for this feature to work you must
      * have `quarkus-vertx-http` on the application classpath.
+     *
+     * **This option is deprecated and will be removed in a future release**.
      */
-    @WithDefault("true")
+    @Deprecated(forRemoval = true)
+    @WithDefault("false")
     boolean registerManagementEndpoint();
 
     /**
diff --git 
a/integration-tests/jolokia/src/main/resources/application.properties 
b/integration-tests/jolokia/src/main/resources/application.properties
index 6c0534afa0..5a8b28d808 100644
--- a/integration-tests/jolokia/src/main/resources/application.properties
+++ b/integration-tests/jolokia/src/main/resources/application.properties
@@ -17,3 +17,4 @@
 
 # Enable in all modes since native testing runs against prod mode and this 
simplifies test assertions
 quarkus.camel.jolokia.server.discovery-enabled-mode=all
+quarkus.camel.jolokia.register-management-endpoint=true

Reply via email to