Change ActiveMQ broker JMX port 1099 in Spring Boot JMS

Viewed 1305

I use Spring Boot with embedded Active-MQ as JMS-Provider and it works quite well but: I need to run multiple instances on one host. When I start the second instance I get the following error:

    2018-12-17 17:23:25.498  WARN 11042 --- [JMX connector] o.a.a.broker.jmx.ManagementContext       : Failed to start JMX connector Cannot bind to URL [rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException: jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]. Will restart management to re-create JMX connector, trying to remedy this issue.

This is of course because port 1099 is already used by the first instance. Sadly I really dont find a way to change this port using any spring.activemq.* property or an instance of ActiveMQConnectionFactoryCustomizer. Can anyone help me?

Best regards, Dominic

1 Answers

Do you even need jmxrmi? You can disable it with (at least for one of your instances):

org.apache.activemq.broker.jmx.createConnector=false

(in application.properties or with VM argument -Dorg.apache.activemq.broker.jmx.createConnector=false)

Related