diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java b/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java index 5f7bba6cf0..bbc8248842 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/util/CommandAgent.java @@ -44,6 +44,8 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean, private static final Log LOG = LogFactory.getLog(CommandAgent.class); private String brokerUrl = "vm://localhost"; + private String username; + private String password; private ConnectionFactory connectionFactory; private Connection connection; private Destination commandDestination; @@ -122,9 +124,25 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean, public void setBrokerUrl(String brokerUrl) { this.brokerUrl = brokerUrl; - } + } - public ConnectionFactory getConnectionFactory() { + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public ConnectionFactory getConnectionFactory() { if (connectionFactory == null) { connectionFactory = new ActiveMQConnectionFactory(brokerUrl); } @@ -160,7 +178,7 @@ public class CommandAgent implements Service, InitializingBean, DisposableBean, } protected Connection createConnection() throws JMSException { - return getConnectionFactory().createConnection(); + return getConnectionFactory().createConnection(username, password); } protected Destination createCommandDestination() { diff --git a/assembly/src/release/conf/activemq.xml b/assembly/src/release/conf/activemq.xml index 3ee0056868..422f962420 100755 --- a/assembly/src/release/conf/activemq.xml +++ b/assembly/src/release/conf/activemq.xml @@ -24,7 +24,11 @@ http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"> - + + + file://${activemq.base}/conf/credentials.properties + + @@ -133,14 +137,20 @@ - + + + + + + + diff --git a/assembly/src/release/conf/credentials.properties b/assembly/src/release/conf/credentials.properties new file mode 100644 index 0000000000..9d34d5a4d7 --- /dev/null +++ b/assembly/src/release/conf/credentials.properties @@ -0,0 +1,2 @@ +activemq.username=system +activemq.password=manager \ No newline at end of file diff --git a/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml b/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml index 8746db7e28..a43d3336fa 100644 --- a/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml +++ b/assembly/src/release/webapps/admin/WEB-INF/webconsole-embedded.xml @@ -18,7 +18,11 @@ - + + + file://${activemq.base}/conf/credentials.properties + + @@ -30,6 +34,8 @@ + +