Skip to content

Commit 9a523cc

Browse files
Merge pull request #18345 from brokenhardisk/master
Integrating Jolokia with Spring Boot
2 parents a3343ed + f6755cb commit 9a523cc

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

spring-boot-modules/spring-boot-libraries-3/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@
9696
<version>${h2.version}</version>
9797
<scope>test</scope>
9898
</dependency>
99+
<dependency>
100+
<groupId>org.jolokia</groupId>
101+
<artifactId>jolokia-support-spring</artifactId>
102+
<version>${jolokia-support-spring.version}</version>
103+
</dependency>
99104
</dependencies>
100105

101106

@@ -106,6 +111,7 @@
106111
<awaitility.version>4.2.0</awaitility.version>
107112
<postgresql.version>42.3.1</postgresql.version>
108113
<h2.version>2.2.224</h2.version>
114+
<jolokia-support-spring.version>2.2.1</jolokia-support-spring.version>
109115
</properties>
110116

111117
</project>

spring-boot-modules/spring-boot-libraries-3/src/main/resources/application.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ spring:
2626
dialect: org.hibernate.dialect.PostgreSQLDialect
2727
hbm2ddl.auto: create
2828

29+
management:
30+
endpoints:
31+
web:
32+
exposure:
33+
include: jolokia
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<restrict>
2+
<remote>
3+
<host>0:0:0:0:0:0:0:1</host>
4+
</remote>
5+
<commands>
6+
<command>read</command>
7+
<command>list</command>
8+
</commands>
9+
<allow>
10+
<mbean>
11+
<name>java.lang:type=Memory</name>
12+
<operation>gc</operation>
13+
</mbean>
14+
</allow>
15+
16+
<deny>
17+
<mbean>
18+
<name>jdk.management.jfr:type=FlightRecorder</name>
19+
<attribute>*</attribute>
20+
<operation>*</operation>
21+
</mbean>
22+
</deny>
23+
</restrict>

0 commit comments

Comments
 (0)