Running ActiveMQ Artemis web console in embedded mode - activemq-artemis

In the artemis example folder, there is a sample that helped me run artemis in embedded mode. This is helpful for me when dealing with unit tests.
Is it possible to view the console in browser (localhost:8161) after running the server in embedded mode.
I found that the console war file is listed in bootstrap.xml file and I tried to place bootstrap.xml file in classpath as well but still not able to run console.
Is it possible to view web console when artemis run in embedded mode?

When you run your own embedded instance of ActiveMQ Artemis the bootstrap.xml file isn't used. That file is only used by a standalone broker. The application which embeds the broker is itself responsible for bootstrapping it (i.e. configuring and passing in all the prerequisites).
By default a standalone broker will configure and start an embedded instance of Jetty. It will also deploy the web console WAR to this Jetty instance. All this is defined in bootstrap.xml.
However, when you embed your own broker all you get is the broker. If you want a web server in your application to serve any web applications (e.g. the ActiveMQ Artemis web console) then you'll have to embed that yourself as well along with the broker.

Related

Log files defined in logging profiles cannot be accessed by management interface in WildFly

I have a WildFly 15.0.1 running in domain mode in a Docker container. It has two logging profiles configured - one for each application deployed on it. When I log in to the HAL Management Console via browser I can see all the logs and their file sizes, but I can only view and download the server.log one.
Trying to download one of the others results in:
"WFLYCTL0216: Management resource '[
(\"subsystem\" => \"logging\"),
(\"log-file\" => \"custom-log-file.log\")
]' not found"
which makes sense as in JBoss CLI those log files are not available directly under logging subsystem, but rather in logging profile details. Is there any way to make them available in the HAL Management Console?
AS #James R. Perkins suggested this behavior is a bug that was solved in HAL 3.0.17.Final. Since WildFly 15.0.1.Final contains HAL 3.0.6.Final and WildFly 16.0.0.Final contains HAL 3.1.2.Final, upgrading to WildFly 16 is one possible solution. The other is to upgrade just the HAL module in WildFly as described here.

Standalone.xml file of jboss equivalent in websphere

I'm trying to migrate a web app from Websphere to JBoss.
I believe the first step is to port the configurations of the server. The main configuration file in Jboss is standalone.xml (or domain.xml for running multiple instances of a server).
Could you tell me what the equivalent of standalone.xml is in websphere ?
Thank you for your time.
There is no direct equivalent. WebSphere is administered via the administration console. If you run WebSphere Express you can connect directly to the app. server's administration port. If you run Network Deployment, you connect to the deployment manager console (DMGR).
The console has all the configuration. They are stored in many XML files, that can be a pain to use directly. Much easier with the console.
The default console port is 9060 (http) or 9043 (https).
URL:
http://yourserver:9060/ibm/console
https://yourserver:9043/ibm/console
See this technote: http://www-01.ibm.com/support/docview.wss?uid=swg21155098
for a bit more information.
You can look at this migration guide for JBoss AS 7.
https://docs.jboss.org/author/display/AS72/How+do+I+migrate+my+application+from+WebSphere+to+AS+7?_sscc=t

How to monitor ActiveMQ Artemis

I'm doing some testing with RabbitMQ, ActiveMQ "Classic" and ActiveMQ Artemis in a Windows .NET environment. RabbitMQ and ActiveMQ "Classic" ship with a web interface where you can see information about your broker, queues, messages etc., but ActiveMQ Artemis does not. I really want to be able to monitor my ActiveMQ Artemis broker in a web interface or at the very least with some cmd/PowerShell commands.
I've read on this page about some third-party tools that can be used to monitor an ActiveMQ instance and I assumed that it also applied to Artemis. Unfortunately, I have not been able to get these third-party tools to work. Some of them don't seem to work well on Windows and some are old/inactive.
My clients are communicating with the brokers through NMS (.NET Messaging API) in C#. If anyone has been able to monitor their Artemis broker, especially on a Windows machine, please let me know how you did it!
EDIT:
I have managed to communicate with the Jolokia REST API now. With a GET request to:
http://username:password#localhost:8161/jolokia/read/org.apache.activemq.artemis:*
I am able to see a bunch of information about my queues such as messages added and consumed. This is nice information that will help me but I would like information about current memory usage and disk usage.
Take a look at the Management chapter of the Artemis manual. As far as I know, the following options are available to you
JMX (Java Management Service)
JMX is a Java API for managing Java servers. There are multiple GUIs that connect to java servers via JMX. The most notable being jConsole. There is a list of other GUIs here or there, or you could build your own
jConsole
jConsole is a GUI application that you can connect to a JMX enabled server. It is a part of the Java JDK, so you probably have it installed already.
Jolokia
Jolokia, tutorial, is a JSON API layer over JMX. It makes the JMX interface accessible over HTTP(S). You may query the information using any HTTP client library. You already figured out this in your question. Again, there are GUIs on top of that, the most notable being
Hawt.io Artemis plugin
Hawt.io is an Angular.js management console. It can be thought of as a GUI for Jolokia.
Artemis 2.6 and newer
Hawt.io plugin is built in, no extra setup necessary.
Artemis 1
There is a hawt.io plugin for Artemis made by Red Hat. Compile the plugin and get a .war file. Artemis contains a built-in Jetty webserver. You need put that war to apache-artemis-1.3.0/web. You also need to download hawtio-default.war from http://hawt.io/getstarted/index.html to the same directory. Then, in the instance directory, edit etc/bootstrap.xml and add these wars to config.
Or you can get Red Hat AMQ 7, currently in Alpha, which has the management plugin built in. Start it up and go to localhost:8161/hawtio. I work for a company that sells that product.
Prometheus and Grafana
There is a repository and an accompanying blogpost that describes Prometheus and Grafana setup with ActiveMQ Artemis, all running in OpenShift.
The jmx exporter for Prometheus contains example config for Artemis 2 to get started.
The simplest and easiest way to monitor the broker is with the ActiveMQ Artemis web console. This was added back in 2.3.0 (released in September 2017). At that time it was based on Hawtio 1, but it was recently updated to Hawtio 2.
The most powerful and flexible way to monitor the broker is to use a metrics plugin. Metrics plugins allow integration with specialized monitoring tools like CloudWatch, Datadog, Dynatrace, Elastic, Prometheus, etc. A Prometheus metrics plugin implementation is available. That combined with a Grafana dashboard for visualization and alerting is very powerful.

Can't Access ActiveMQ Web Console

I am having trouble accessing ActiveMQ's web console.
On their website it says you can access the console through the URL : localhost:8161/admin
But all I get when I try this is "This webpage is not available"
I found another site saying I can access it through port '61616', which gives me a response in the form of the following :
I have done some extensive searching on this issue, and have found others with the same problem, but have not come across a solution.
I am fairly new to using ActiveMQ so please excuse me if I have left out any relevant information.
Any help is greatly appreciated.
The admin console is a web application (WAR-file) deployed in an embedded Jetty server that starts up along with ActiveMQ standalone distribution.
Since you intend to run ActiveMQ inside a web application inside Tomcat, it would not make sense to fire up a jetty server.
Simply deploy the web console WAR to your Tomcat. You need to point out the JMS/OpenWire connection URI as well as JMX connection URI to ActiveMQ Web Console to get it going. Typically in Tomcat setenv.sh (or similar file):
JAVA_OPTS="$JAVA_OPTS -Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://localhost:61616- Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi -Dwebconsole.jmx.user=admin -Dwebconsole.jmx.password=mypassw0rd"
This requires you to have JMX setup on your Tomcat instance. If not, check this Tomcat doc page out.
This will deploy the console just like any app in your Tomcat (not port 8161).
Off-topic, but a nice feature with decoupling the web console from the actual broker is that you can access a the activem broker of a master/slave pair using failover protocol and comma separated jmx settings.

Can a deployed JBoss web application simply disappear?

A strange problem occurred yesterday on a production system which has been running fine for weeks on a JBoss 4.2.3 application server: the JAR file containing the web application was no longer in the deployment folder (so the clients could no longer access the application). The server is running on a Windows box.
There was no indication of undeployment in the server logs. Normally JBoss detects if somebody deletes (or moves) a deployed web application file and executes the standard undeployment procedure, so there would be a log entry in this case.
Other web applications on the same system continued to run fine, so it was only this JAR file which simply disappeared.
Has somebody seen a similar problem with web applications on JBoss?
I'd bet my shoes that's not possible to happen spontaneously.
Check your security settings - didn't you leave JMX console accessible? Etc.