Thank you very much for your reply !!
It works exactly the way I needed to have it ! Since you mentioned the Firewall-Issue:
As said, to preset the "ServicePort" for ActiveMQ:
<managementContext>
<managementContext createConnector="true" connectorPort="10120" rmiServerPort="10135" jmxDomainName="my-broker" connectorPath="/jmxrmiaq" />
</managementContext>
Where 10120 is the Registry port and 10135 the ServicePort where the socketcommunication happens.
To do the same in Java-Code, the url-String for the JMXServiceURL needs to be something rather cryptic:
String url = "service:jmx:rmi://localhost:10136/jndi/rmi://localhost:10120/jmxapp1";
// original String without fixed ServicePort: String url = "service:jmx:rmi:///jndi/rmi://localhost:10120/jmxapp1";
JMXServiceURL serviceURL = new JMXServiceURL(url);
JMXConnectorServer server = JMXConnectorServerFactory.newJMXConnectorServer(serviceURL, null, mbs);
System.out.println("\nStarting monitored app @ " + url);
server.start();
Michael