mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5121 - use jmxLocal in karaf only for jmx-based commands
This commit is contained in:
parent
357d491cbe
commit
fb684db4a8
|
@ -67,6 +67,7 @@ public class ActiveMQBrokerFeatureTest extends AbstractJmsFeatureTest {
|
||||||
produceMessage(nameAndPayload);
|
produceMessage(nameAndPayload);
|
||||||
|
|
||||||
System.err.println(executeCommand("activemq:bstat").trim());
|
System.err.println(executeCommand("activemq:bstat").trim());
|
||||||
|
assertEquals("JMS_BODY_FIELD:JMSText = " + nameAndPayload, executeCommand("activemq:browse --amqurl tcp://localhost:61616 --user karaf --password karaf -Vbody " + nameAndPayload).trim());
|
||||||
|
|
||||||
assertEquals("got our message", nameAndPayload, consumeMessage(nameAndPayload));
|
assertEquals("got our message", nameAndPayload, consumeMessage(nameAndPayload));
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
package org.apache.activemq.karaf.commands;
|
package org.apache.activemq.karaf.commands;
|
||||||
|
|
||||||
import org.apache.activemq.console.CommandContext;
|
import org.apache.activemq.console.CommandContext;
|
||||||
|
import org.apache.activemq.console.command.AbstractJmxCommand;
|
||||||
import org.apache.activemq.console.command.Command;
|
import org.apache.activemq.console.command.Command;
|
||||||
import org.apache.activemq.console.formatter.CommandShellOutputFormatter;
|
import org.apache.activemq.console.formatter.CommandShellOutputFormatter;
|
||||||
import org.apache.felix.gogo.commands.Argument;
|
import org.apache.felix.gogo.commands.Argument;
|
||||||
|
@ -42,7 +43,9 @@ public class ActiveMQCommandSupport extends OsgiCommandSupport {
|
||||||
try {
|
try {
|
||||||
currentCommand.setCommandContext(context2);
|
currentCommand.setCommandContext(context2);
|
||||||
// must be added first
|
// must be added first
|
||||||
arguments.add(0, "--jmxlocal");
|
if (command instanceof AbstractJmxCommand) {
|
||||||
|
arguments.add(0, "--jmxlocal");
|
||||||
|
}
|
||||||
currentCommand.execute(arguments);
|
currentCommand.execute(arguments);
|
||||||
return null;
|
return null;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
Loading…
Reference in New Issue