diff --git a/examples/features/standard/client-kickoff/pom.xml b/examples/features/standard/client-kickoff/pom.xml index 88a9de1e64..90f6d752d3 100644 --- a/examples/features/standard/client-kickoff/pom.xml +++ b/examples/features/standard/client-kickoff/pom.xml @@ -56,9 +56,7 @@ under the License. ${noServer} - - -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false - + -Djava.rmi.server.hostname=localhost diff --git a/examples/features/standard/client-kickoff/readme.md b/examples/features/standard/client-kickoff/readme.md index efc27616c0..595901fe70 100644 --- a/examples/features/standard/client-kickoff/readme.md +++ b/examples/features/standard/client-kickoff/readme.md @@ -4,19 +4,4 @@ To run the example, simply type **mvn verify** from this directory, or **mvn -Pn This example shows how to kick off a client connected to ActiveMQ using [JMX](http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html) -The example will connect to ActiveMQ Artemis. Using JMX, we will list the remote addresses connected to the broker and close the corresponding connections. The client will be kicked off from ActiveMQ Artemis receiving an exception that its JMS connection was interrupted. - -## Example configuration - -ActiveMQ Artemis exposes its managed resources by default on the platform MBeanServer. - -To access this MBeanServer remotely, the Java Virtual machine must be started with system properties: - - -Dcom.sun.management.jmxremote - -Dcom.sun.management.jmxremote.port=3000 - -Dcom.sun.management.jmxremote.ssl=false - -Dcom.sun.management.jmxremote.authenticate=false - -These properties are explained in the Java [management guide](https://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html#gdenl) (please note that for this example, we will disable user authentication for simplicity). - -With these properties, ActiveMQ Artemis broker will be manageable remotely using standard JMX URL on port `3000`. \ No newline at end of file +The example will connect to ActiveMQ Artemis. Using JMX, we will list the remote addresses connected to the broker and close the corresponding connections. The client will be kicked off from ActiveMQ Artemis receiving an exception that its JMS connection was interrupted. \ No newline at end of file diff --git a/examples/features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java b/examples/features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java index c8753ee7d5..52ad778724 100644 --- a/examples/features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java +++ b/examples/features/standard/client-kickoff/src/main/java/org/apache/activemq/artemis/jms/example/ClientKickoffExample.java @@ -38,7 +38,7 @@ import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder; */ public class ClientKickoffExample { - private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3000/jmxrmi"; + private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"; public static void main(final String[] args) throws Exception { QueueConnection connection = null; diff --git a/examples/features/standard/client-kickoff/src/main/resources/activemq/server0/management.xml b/examples/features/standard/client-kickoff/src/main/resources/activemq/server0/management.xml new file mode 100644 index 0000000000..d894b9f150 --- /dev/null +++ b/examples/features/standard/client-kickoff/src/main/resources/activemq/server0/management.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/features/standard/xa-heuristic/pom.xml b/examples/features/standard/xa-heuristic/pom.xml index 02f9971b4a..c8ad1c4539 100644 --- a/examples/features/standard/xa-heuristic/pom.xml +++ b/examples/features/standard/xa-heuristic/pom.xml @@ -55,9 +55,8 @@ under the License. create - -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3001 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false - ${noServer} + -Djava.rmi.server.hostname=localhost diff --git a/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java b/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java index 2d5a2acfe1..e816f41b02 100644 --- a/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java +++ b/examples/features/standard/xa-heuristic/src/main/java/org/apache/activemq/artemis/jms/example/XAHeuristicExample.java @@ -48,7 +48,7 @@ import org.apache.activemq.artemis.utils.UUIDGenerator; */ public class XAHeuristicExample { - private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:3001/jmxrmi"; + private static final String JMX_URL = "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"; public static void main(final String[] args) throws Exception { Boolean result = true; diff --git a/examples/features/standard/xa-heuristic/src/main/resources/activemq/server0/management.xml b/examples/features/standard/xa-heuristic/src/main/resources/activemq/server0/management.xml new file mode 100644 index 0000000000..d894b9f150 --- /dev/null +++ b/examples/features/standard/xa-heuristic/src/main/resources/activemq/server0/management.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file