alxbxbx
alxbxbx

Reputation: 323

ActiveMQ Artemis JMX access

I would like to know if there is a way to access values of MBeans in Apache Artemis. The problem is that MBeans access is protected by role access defined in management.xml. When you are accessing MBeans you should have role required in settings, but from my Java app I cannot apply role when I'm accessing MBeans. Same thing happens when I use VisualVM, I can see list of MBeans but due to access constraint I cannot see value of MBeans.

One workaround is to actually remove <authorization> element from management.xml or to simply add org.apache.activemq.artemis in <whitelist> element.

It would be nice if I could do it via reflection in runtime. I've tried couple of times but didn't have much success. Is there a way to override any of Artemis' properties in runtime and that way make access possible?

Upvotes: 0

Views: 2200

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 35122

MBean access restriction is part of the security of the broker. Having a way to circumvent that security or just disable it at runtime without the proper authentication & authorization would be a significant security hole. If MBean access wasn't restricted then anyone with remote access could shut the broker down or even delete all the messages in your queues.

If you want to access the MBeans without restriction you'll need to change management.xml as you noted.

You could also just submit the proper username & password from your application so that the broker would grant you access.

Upvotes: 2

Related Questions