How to enable web console on ActiveMq embedded bro

2019-03-30 08:43发布

问题:

I've configured an ActiveMQ 5.8.0 embedded broker using Spring 3.2.5

This is my jmsconfiguration.xml

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

    <amq:broker brokerName="localhost" dataDirectory="./data" useJmx="true" persistent="true">
        <amq:persistenceAdapter>
            <amq:kahaDB directory="./kahadb" checksumJournalFiles="true" checkForCorruptJournalFiles="true" />
        </amq:persistenceAdapter>
        <amq:transportConnectors>
            <amq:transportConnector name="websocket" uri="ws://0.0.0.0:61614"/>
            <amq:transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
            <amq:transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
        </amq:transportConnectors>
    </amq:broker>

    <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost" />
</beans>

It would be very nice and useful to be able to access web console ... however i've been trying to enable it without success.

Does anyone knows how to configure it?

回答1:

You can try hawtio instead - http://hawt.io/

It allows to be installed independent of where the broker resides, and can look inside the JVM to find the broker, and still be used as web console to manage the broker.

hawtio is included out of the box in ActiveMQ 5.9 onwards, and is to replace the old console (the old console is deprecated but still included, but will be removed in a future release).

hawtio can also manage other stuff in the JVM such as Camel, and show JMX, and whatnot.

If you want to include the old web console in your current spring application, then that can be tough as you would need to include all its html/jps content and whatnot. Its not an easy task to do. And then setup your web.xml to include what the old console needs, and so forth.