Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change ActiveMQ broker JMX port 1099 in Spring Boot JMS

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

like image 471
Dominic Avatar asked Oct 20 '25 14:10

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)

like image 73
Balázs Avatar answered Oct 22 '25 05:10

Balázs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!