You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "kulagaIA (via GitHub)" <gi...@apache.org> on 2024/02/03 12:16:51 UTC
[PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
kulagaIA opened a new pull request, #12985:
URL: https://github.com/apache/camel/pull/12985
# Description
`camel-jolokia` is now a context plugin with `@DevConsole` annotation.
I was not able to generate file `core/camel-jolokia/src/generated/resources/META-INF/services/org/apache/camel/dev-console/jolokia` with the `camel-package-maven-plugin`. This file was added by hands, and it is possible that something is wrong with `camel-jolokia` maven configuration, or something is wrong with the plugin (see https://camel.zulipchat.com/#narrow/stream/364655-camel-core-dev/topic/how.20to.20add.20context.20plugin ).
Also added jolokia to example repo: https://github.com/apache/camel-examples/pull/133
# Tracking
https://issues.apache.org/jira/browse/CAMEL-20361
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306368
:robot: The Apache Camel test robot will run the tests for you :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925639338
jolokia should be option and not in core at all. Instead there should be a more generic factory for platform-http, that can load jolokia and whatelse we add in the future.
It should be platform-http that when it startup (doInit etc) will check if jolokia is configured to be enabled, and then use the factory to find the JAR (if present) and if present then create the factory and does what it need to do. If the JAR is not present then some exception is thrown. We do this elsewhere in Camel.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #12985:
URL: https://github.com/apache/camel/pull/12985#discussion_r1477219154
##########
core/camel-api/pom.xml:
##########
@@ -56,6 +56,13 @@
<scope>compile</scope>
</dependency>
+ <dependency>
Review Comment:
camel-api should NOT have any other dependencies, this must be removed
##########
core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java:
##########
@@ -370,6 +371,7 @@ protected void initPlugins() {
camelContextExtension.lazyAddContextPlugin(AnnotationBasedProcessorFactory.class,
this::createAnnotationBasedProcessorFactory);
camelContextExtension.lazyAddContextPlugin(DumpRoutesStrategy.class, this::createDumpRoutesStrategy);
+ camelContextExtension.lazyAddContextPlugin(JolokiaHttpRequestHandlerFactory.class, this::createJolokiaHttpRequestHandlerFactory);
Review Comment:
Jolokia should only be discovered if enabled, eg that jolokiaEnabled option in camel-main
##########
core/camel-api/src/main/java/org/apache/camel/spi/JolokiaHttpRequestHandlerFactory.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.spi;
+
+import org.apache.camel.StaticService;
+import org.jolokia.server.core.http.HttpRequestHandler;
+
+/**
+ * Factory to abstract the creation of the Jolokia HttpRequestHandler.
+ */
+public interface JolokiaHttpRequestHandlerFactory extends StaticService {
Review Comment:
We should make a generic factory that just returns Object or / Class<T> T so we can use this for other stuff we can plugin into http-server in the future.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1946954628
:robot: The Apache Camel test robot will run the tests for you :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "kulagaIA (via GitHub)" <gi...@apache.org>.
kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1931961231
> @kulagaIA I wonder if you will get more time for this before start of next week, as that is the deadline where we will cut the next 4.4 LTS release.
Inteding to finish before 12.07.24, is it ok?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1931954517
@kulagaIA I wonder if you will get more time for this before start of next week, as that is the deadline where we will cut the next 4.4 LTS release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1946989599
:robot: The Apache Camel test robot will run the tests for you :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "kulagaIA (via GitHub)" <gi...@apache.org>.
kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306299
/component-test camel-platform-http-main
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925414997
:robot: The Apache Camel test robot will run the tests for you :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "kulagaIA (via GitHub)" <gi...@apache.org>.
kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1946953247
/component-test camel-platform-http-main camel-platform-http camel-platform-http-jolokia
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "kulagaIA (via GitHub)" <gi...@apache.org>.
kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1946988002
/component-test camel-platform-http-main camel-platform-http camel-platform-http-jolokia
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1931974847
> > @kulagaIA I wonder if you will get more time for this before start of next week, as that is the deadline where we will cut the next 4.4 LTS release.
> > Inteding to finish before 12.07.24, is it ok?
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "kulagaIA (via GitHub)" <gi...@apache.org>.
kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1947065187
Made PlatformHttpPluginRegistry in camel-platform-http to be a generic factory for platform-http, that can load jolokia and whatelse we add in the future.
Also, apologies for messing up with the commit dates, wanted to finish before 4.4 LTS but got sick
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306026
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
* You can label PRs using `build-all`, `build-dependents`, `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the Summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
* :warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "kulagaIA (via GitHub)" <gi...@apache.org>.
kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306346
/component-test camel-jolokia
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "kulagaIA (via GitHub)" <gi...@apache.org>.
kulagaIA commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925414910
/component-test camel-jolokia
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12985:
URL: https://github.com/apache/camel/pull/12985#issuecomment-1925306410
:robot: The Apache Camel test robot will run the tests for you :+1:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #12985:
URL: https://github.com/apache/camel/pull/12985#discussion_r1477063321
##########
core/pom.xml:
##########
@@ -59,6 +59,7 @@
<module>camel-cloud</module>
<module>camel-health</module>
<module>camel-console</module>
+ <module>camel-jolokia</module>
Review Comment:
jolokia should not be a core module, move this under components
##########
core/camel-jolokia/src/main/java/org/apache/camel/impl/jolokia/DefaultJolokiaHttpRequestHandlerFactory.java:
##########
@@ -36,17 +37,21 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class JolokiaHttpRequestHandlerSupport extends ServiceSupport implements StaticService {
+/**
+ * Default {@link org.apache.camel.console.DevConsoleRegistry}.
+ */
+@DevConsole("jolokia")
Review Comment:
This is wrong. @DevConsole is only for camel-console type of consoles.
You need to come up with another annotation such as JdkFactory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20361: camel-jbang - Make jolokia pluggable for camel-platform-http-main [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #12985:
URL: https://github.com/apache/camel/pull/12985#discussion_r1491991320
##########
components/camel-platform-http-jolokia/src/main/java/org/apache/camel/component/platform/http/plugin/DefaultJolokiaPlatformHttpPlugin.java:
##########
@@ -58,21 +62,22 @@ public JolokiaHttpRequestHandlerSupport() {
serviceManager.addService(new JolokiaSerializer());
serviceManager.addService(new LocalRequestHandler(1));
- LOG.info("Creating JolokiaHttpRequestHandlerSupport with restrictor {}", restrictor);
+ LOG.info("Creating DefaultJolokiaPlatformHttpPlugin with restrictor {}", restrictor);
}
@Override
- public void start() {
+ public void doStart() {
var jolokiaContext = serviceManager.start();
requestHandler = new HttpRequestHandler(jolokiaContext);
}
@Override
- public void stop() {
+ public void doStop() {
serviceManager.stop();
Review Comment:
Add if (serviceManager != null)
##########
components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServer.java:
##########
@@ -465,17 +479,22 @@ protected void setupJolokia() {
platformHttpComponent.addHttpEndpoint("/q/jolokia", null, null);
}
+ protected PlatformHttpPluginRegistry resolvePlatformHttpPluginRegistry() {
+ Optional<PlatformHttpPluginRegistry> result = ResolverHelper.resolveService(
+ getCamelContext(),
+ PlatformHttpPluginRegistry.FACTORY,
+ PlatformHttpPluginRegistry.class);
+ return result.orElse(null);
+ }
+
private HttpRequestHandler getHttpRequestHandler() {
- //TODO: make jolokiaService more pluggable
- //JolokiaHttpRequestHandlerSupport jolokiaService = camelContext.getCamelContextExtension().getContextPlugin(JolokiaHttpRequestHandlerSupport.class);
- HttpRequestHandler requestHandler;
- try (JolokiaHttpRequestHandlerSupport jolokiaService = new JolokiaHttpRequestHandlerSupport()) {
- jolokiaService.start();
- requestHandler = jolokiaService.getHttpRequestHandler();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- return requestHandler;
+ PlatformHttpPluginRegistry registry
+ = camelContext.getCamelContextExtension().getContextPlugin(PlatformHttpPluginRegistry.class);
+ JolokiaPlatformHttpPlugin jolokia
Review Comment:
Jolokia should only be discovered if jolokiaEnabled
##########
components/camel-platform-http-jolokia/pom.xml:
##########
@@ -0,0 +1,95 @@
+<?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</groupId>
+ <artifactId>components</artifactId>
+ <version>4.4.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-platform-http-jolokia</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Camel :: Platform HTTP :: Jolokia</name>
+ <description>Jolokia plugin for standalone Camel HTTP Platform</description>
+
+ <properties>
+ <firstVersion>4.4.0</firstVersion>
Review Comment:
4.5.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org