2

I know that spring boot automatically expose JMX beans and i know also that JMX does have a default port: 1099.

To override jmx default port/hostname am just followed this and it's working for me. My question is : is there a properties provided by spring boot to achieve this out of the box like :

spring.application.admin.jmx-port=<PORT_NUMBER>
spring.application.admin.jmx-host=<HOST_IP>
Community
  • 1
  • 1
mtbadi39
  • 448
  • 6
  • 18
  • Have you tried this one: http://stackoverflow.com/questions/834581/remote-jmx-connection ? – Michał Zaborowski May 05 '16 at 14:52
  • @Michał Zaborowski : maybe you don't completely understand my question !!!! – mtbadi39 May 08 '16 at 08:07
  • You can pass configuration to JVM -D / $JAVA_OPTS - as described in post I've provided. The way you described is to provide configuration/factory that constructs RMI/JMX bean. That way you can inject parameters. As described here: https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html So you need to put your `spring.application.admin.jmx-port` to your `application.properties`, and use same name here `@Value("${jmx.rmi.port:1099}")`. – Michał Zaborowski May 08 '16 at 09:15
  • Hi @Michał Zaborowski, what if i don't want externalized properties (neither environment variables nor command-line arguments ) just properties file inside the jar. thanks – mtbadi39 May 09 '16 at 09:21
  • Let's start form beginning. Answering to your initial question - no, you need to do that yourself. Use your sample, put appropriate names, can be that two, you have proposed. And then put them to application.properties, with values. Did not get what is working / what is not. Spring uses Oracle's implementation of JMX - perhaps that is why it looks like that... – Michał Zaborowski May 11 '16 at 14:20

0 Answers0