I am a junior Java developer, and I made a simple sample of embedded ActiveMQ Artemis programmatic. It works correctly, but I want to monitor it on my browser on http://localost:8161 (like ActiveMQ Artemis that I install and run standalone). However, in embedded mode it didn't give me the web console, and I can't find any correct sample on any where to see it. Somewhere people say about Hawtio, JMX, and other ways but they didn't work correctly. Can somebody give a simple demo to me please?
JMX Hawtio and other things didn't work.
This is my simple class :
import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
public class EmbeddedActiveMq {
public static void main(String[] args) throws Exception {
ConfigurationImpl config = new ConfigurationImpl()
.addAcceptorConfiguration("in-vm", "vm://0")
.addAcceptorConfiguration("tcp", "tcp://localhost:61616")
.setJMXManagementEnabled(true);
EmbeddedActiveMQ server = new EmbeddedActiveMQ();
server.setConfiguration(config);
server.start();
System.out.println("artemis is ok");
while (true) {
}
}
}
These are my dependencies:
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-web</artifactId>
<version>2.29.0</version>
</dependency>
<dependency>
<groupId>io.hawt</groupId>
<artifactId>hawtio-default</artifactId>
<version>2.12.0</version>
<type>war</type>
</dependency>
</dependencies>
Update:
I used your solution, Mr. Bertram, and now I have a little problem. It listens on port 8161, but it seems I did something wrong:
For pathToArtemis i use this path:
.m2/repository/org/apache/activemq/artemis-server/2.16.0/artemis-server-2.16.0.jar
and this path :
.m2/repository/org/apache/activemq/artemis-web/2.16.0/artemis-web-2.16.0.jar and the installation directory of artemis, but none of them did work, and I get nothing in panel.


You can enable the management console via an embedded instance of Jetty managed by the broker using the following code:
Your
login.configmight look something like this:hawtio-users.properties:hawtio-roles.properties:Then you can login to the console at
http://localhost:8161/consolewith the usermyUserand the passwordmyPass.Lastly, I believe you can simplify your dependencies down to this: