We want to put a load-balancer (F5) pointing to web console of the ActiveMQ Artemis instance which is active.
We want to put a load-balancer (F5) pointing to web console of the ActiveMQ Artemis instance which is active.
The ActiveMQServerControl MBean has a method called isActive() which returns true if the broker is active and false if it is not. That should allow you to point the load-balancer at the proper web console.
The management API is exposed via JMX, management messages, HTTP (via Jolokia), etc. Here's an example using curl:
curl -H "Origin: http://localhost" -u myUser:myPass http://localhost:8161/console/jolokia/read/org.apache.activemq.artemis:broker=\"0.0.0.0\"/Active
This will return a JSON response, e.g.:
{
"request": {
"mbean": "org.apache.activemq.artemis:broker=\"0.0.0.0\"",
"attribute": "Active",
"type": "read"
},
"value": true,
"timestamp": 1663085210,
"status": 200
}