Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting ActiveMQ Web-Console to an existing broker (instead of starting a new one)

Having deployed the activemq-web-console war into a Tomcat embedded application how can one make it connect to an existing broker rather than create a new one?

The war comes with a set of predefined configurations, in particular, the WEB-INF/activemq.xml contains a configuration for the BrokerService

<broker brokerName="web-console" useJmx="true" xmlns="http://activemq.apache.org/schema/core">
  <persistenceAdapter><kahaDB directory="target/kahadb"/></persistenceAdapter>

  <transportConnectors>
    <transportConnector uri="tcp://localhost:12345"/>
  </transportConnectors>
</broker>

used from webconsole-embedded.xml in the following manner:

<bean id="brokerService" class="org.apache.activemq.xbean.BrokerFactoryBean">
  <property name="config" value="/WEB-INF/activemq.xml"/>
</bean>

This configuration creates a new instance of BrokerService and tries to start the broker.

It is reported that the web console can be used to monitor an existing broker service rather than creating a new one. For this one should set the following properties somewhere:

webconsole.type=properties
webconsole.jms.url=tcp://localhost:61616
webconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-trun

The questions is, where does one have to set these properties within the Tomcat embedded app and which XML changes in the above have to be performed for them to be used. I cannot find any sensible explanation how to configure it, and a BrokerService instance seems to be required by the remaining spring config.

Any ideas?

Please do not suggest to use hawtio instead!

like image 821
Oleg Sklyar Avatar asked Jan 09 '18 09:01

Oleg Sklyar


People also ask

How do I connect to ActiveMQ console?

To access the management console use a browser and go to the URL http://localhost:8161/console. A login screen will be presented, if your broker is secure, you will need to use a user with admin role, if it is unsecure simply enter any user/password.


1 Answers

I had the same problem today. You can start the webconsole in "properties" mode which gives you the oppertunity to connect over jmx.

I added following java arguments to our Jboss 6.1 and it worked immediatley. I didn't change any of the xmls (works out of the box)...

Example:

-Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://<hostname>:61616 -Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://<hostname>:1090/jmxrmi -Dwebconsole.jmx.user=admin -Dwebconsole.jmx.password=123456 

Also discussed here: https://svn.apache.org/repos/infra/websites/production/activemq/content/5.7.0/web-console.html

like image 140
Kim Zeevaarders Avatar answered Nov 15 '22 08:11

Kim Zeevaarders