spring-bootactivemq-artemis

Spring Boot Artemis Server connect Web Console


How do I connect the Web Console to an Spring Boot embedded Artemis Server ?

I have mostly followed this Answer.

But now when I access the webconsole - ERROR:

My Artemis Server is running in a minimalistic Spring Boot App:

  @Configuration
  public class ArtemisConfig implements ArtemisConfigurationCustomizer {

    @Autowired
    private ArtemisProperties artemisProperties;

    @Override
    public void customize(org.apache.activemq.artemis.core.config.Configuration configuration) {
      try{

        configuration.setJMXManagementEnabled(true);
        configuration.setSecurityEnabled(false);
        configuration.addAcceptorConfiguration("netty", "tcp://localhost:" + artemisProperties.getPort());

      } catch (Exception e) {
        throw new RuntimeException("queue did not start");
      }
    }
  }

Solution

  • The only real problem the answer you cited is that it was written for ActiveMQ "Classic" rather than ActiveMQ Artemis. ActiveMQ Artemis doesn't use activemq-web-console-5.16.3.war. It uses a web console based on Hawtio 2 which is split up across 3 different war files:

    Deploy these to your embedded servlet container (e.g. Tomcat, Jetty, etc.). I don't think you'll need to set any system properties, but during the release process we actually strip out any SLF4J and Log4j jar files so you may need to add those back in if your environment doesn't already provide them. We remove those jars because we actually ship SLF4J in the main lib directory of the standalone broker, and we don't actually need Log4j (since ActiveMQ Artemis uses JBoss Logging) so it's safer to remove it (especially in the wake of all the recent Log4j CVEs). See ARTEMIS-3612 for more details on that.

    The web console application running in the browser communicates with the broker via Jolokia which is an HTTP-JMX bridge. Jolokia is part of the Hawtio 2 infrastructure and is included in the aforementioned war files. If the war files are being hosted in the same JVM as your Spring Boot application with ActiveMQ Artemis embedded then you should just need to point the web console app to the same server & port you're using for the console itself. If the web console is hosted separately from the Spring Boot app then you should install Jolokia and then point the web console to it.