RFR: 7455: Add support for jolokia JMX service connection

Martin Skarsaune duke at openjdk.java.net
Fri Nov 26 06:08:38 UTC 2021


On Tue, 26 Oct 2021 19:58:20 GMT, Martin Skarsaune <duke at openjdk.java.net> wrote:

> Make use of support for JMX service connection in jolokia 1.7.0 and later to connect to JVMs over this protocol.

> 

@reinhapa : Please help creating an issue. I do not have access.

application/org.openjdk.jmc.jolokia/pom.xml line 64:

> 62: 			</plugin>
> 63: 			<plugin>
> 64: 				<groupId>org.apache.maven.plugins</groupId>

Sooo .... I am not sure about the preferred way to pull in external dependencies. I can add that both jolokia libraries come as shaded jars with some OSGi packaging, but I do not know enough about that to say whether that would be a workable or better solution. These are quite new components, so we can probably modify the OSGI packaging in Jolokia going forwards if needed. 
POM: https://github.com/rhuss/jolokia/blob/556b58e63a125fb79d516d7f7833e22270f591b0/client/jmx-adapter/pom.xml#L129
Artifact: https://repo1.maven.org/maven2/org/jolokia/jolokia-jmx-adapter/1.7.0/jolokia-jmx-adapter-1.7.0-standalone.jar

application/org.openjdk.jmc.kubernetes/pom.xml line 65:

> 63: 			<plugin>
> 64: 				<groupId>org.apache.maven.plugins</groupId>
> 65: 				<artifactId>maven-dependency-plugin</artifactId>

Same question as for jolokia pom.xml. 
Corresponding resources:
https://github.com/rhuss/jolokia/blob/556b58e63a125fb79d516d7f7833e22270f591b0/client/kubernetes/pom.xml#L44
https://repo1.maven.org/maven2/org/jolokia/jolokia-kubernetes/1.7.0/jolokia-kubernetes-1.7.0-standalone.jar

application/tests/org.openjdk.jmc.jolokia.test/src/test/java/org/openjdk/jmc/jolokia/JolokiaTest.java line 102:

> 100: 	public void testReadAttributesOverJolokia() throws MalformedURLException, IOException, OperationsException,
> 101: 			IntrospectionException, AttributeNotFoundException, ReflectionException, MBeanException {
> 102: 		for (ObjectName objectName : jolokiaConnection.queryNames(null, null)) {

Iterating over all attributes may require some maintenance. However it will also detect any problems with this connector for new JVM developments. 
I can consider just testing a few select attributes instead.

application/tests/org.openjdk.jmc.jolokia.test/src/test/java/org/openjdk/jmc/jolokia/JolokiaTest.java line 127:

> 125: 	}
> 126: 
> 127: 	private static MBeanServerConnection getJolokiaMBeanConnector() throws IOException, MalformedURLException {

Testing discovery may pose for CI environments (?). We can consider making it manual if networking is an issue

-------------

PR: https://git.openjdk.java.net/jmc/pull/332


More information about the jmc-dev mailing list