RFR: 7455: Add support for jolokia JMX service connection [v12]
Alex Macdonald
aptmac at openjdk.org
Thu May 2 18:20:15 UTC 2024
On Thu, 2 May 2024 18:17:29 GMT, Martin Skarsaune <duke at openjdk.org> wrote:
>> Replaces parts of https://github.com/openjdk/jmc/pull/332
>
> Martin Skarsaune has updated the pull request incrementally with 10 additional commits since the last revision:
>
> - JMC-7455: Updated copyright in coverage pom.xml
> - JMC-7455: Added jolokia to coverage
> - JMC-7455: Remove mess of jolokia versions in pom files
> - JMC-7455: Upgrade to latest jolokia (and give up on JVM discovery for now)
> - JMC-7455: Fix for linux. Handle invoke with no parameters
> - JMC-7455: Work around another Jolokia exception observed from MBean console in Linux
> - JMC-7455: Work around Jolokia issues seen from MBean console
> - JMC-7455: Review: restriction warning
> - JMC-7455: Fixes for review comments, copyright notices and other improvements
> - JMC-7455: Fix Eclipse warning
Overall this is looking nice. The tests pass and I was able to connect over Jolokia to the test jvm and verify that the mbean browser & recordings work as expected. To test I added this to the test class:
diff --git a/application/tests/org.openjdk.jmc.jolokia.test/src/test/java/org/openjdk/jmc/jolokia/JolokiaTest.java b/application/tests/org.openjdk.jmc.jolokia.test/src/test/java/org/openjdk/jmc/jolokia/JolokiaTest.java
index 7b65e835..a245f4b1 100644
--- a/application/tests/org.openjdk.jmc.jolokia.test/src/test/java/org/openjdk/jmc/jolokia/JolokiaTest.java
+++ b/application/tests/org.openjdk.jmc.jolokia.test/src/test/java/org/openjdk/jmc/jolokia/JolokiaTest.java
@@ -81,7 +81,11 @@ public class JolokiaTest {
Awaitility.await().atMost(Duration.ofSeconds(15))//Note: hard code property to avoid module dependency on agent
.until(() -> (jolokiaUrl = System.getProperty("jolokia.agent")) != null);
jolokiaConnection = getJolokiaMBeanConnector();
-
+ try {
+ Thread.sleep(500000000);
+ } catch (Exception e) {
+ // do nothing, let's take a look at the jolokia ..
+ }
}
@Test
and then added a new connection and connected using the custom jmx service url.
What is your current plans for this PR? Did you want to try and get the JVM Discovery working before turning it from draft to ready for review? Or is the current functionality what you're currently hoping to have integrated?
application/tests/org.openjdk.jmc.jolokia.test/pom.xml line 51:
> 49: </properties>
> 50:
> 51: <dependencies>
Tried running the tests but was missing this dependency. The root pom has `jolokia.version` as 1.7.2, and the releng/third-party pom has it as 2.0.2, did you mean to mix the two versions?
diff --git a/application/tests/org.openjdk.jmc.jolokia.test/pom.xml b/application/tests/org.openjdk.jmc.jolokia.test/pom.xml
index 79fc76f4..f46397fa 100644
--- a/application/tests/org.openjdk.jmc.jolokia.test/pom.xml
+++ b/application/tests/org.openjdk.jmc.jolokia.test/pom.xml
@@ -54,6 +54,11 @@
<artifactId>awaitility</artifactId>
<version>4.0.0</version>
</dependency>
+ <dependency>
+ <groupId>org.jolokia</groupId>
+ <artifactId>jolokia-jvm</artifactId>
+ <version>${jolokia.version}</version>
+ </dependency>
</dependencies>
<build>
-------------
PR Review: https://git.openjdk.org/jmc/pull/548#pullrequestreview-2029352280
PR Review Comment: https://git.openjdk.org/jmc/pull/548#discussion_r1583593940
More information about the jmc-dev
mailing list