Skip to content

Commit dd20aac

Browse files
Merge pull request #18404 from SmartyAnsh/BAEL-6479-management-interface-quarkus
BAEL-6479 - management interface in Quarkus
2 parents d8ea117 + 6b5f58d commit dd20aac

File tree

5 files changed

+106
-0
lines changed

5 files changed

+106
-0
lines changed

quarkus-modules/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<module>quarkus-langchain4j</module>
3232
<!-- <module>quarkus-rbac</module> --> <!-- JAVA-42048 -->
3333
<module>quarkus-websockets-next</module>
34+
<module>quarkus-management-interface</module>
3435
</modules>
3536

3637
</project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
### Relevant Articles
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>com.baeldung.quarkus</groupId>
7+
<artifactId>quarkus-management-interface</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
<name>quarkus-management-interface</name>
10+
11+
<parent>
12+
<groupId>com.baeldung</groupId>
13+
<artifactId>quarkus-modules</artifactId>
14+
<version>1.0.0-SNAPSHOT</version>
15+
</parent>
16+
17+
<dependencyManagement>
18+
<dependencies>
19+
<dependency>
20+
<groupId>io.quarkus</groupId>
21+
<artifactId>quarkus-bom</artifactId>
22+
<version>${quarkus.version}</version>
23+
<type>pom</type>
24+
<scope>import</scope>
25+
</dependency>
26+
</dependencies>
27+
</dependencyManagement>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>io.quarkus</groupId>
32+
<artifactId>quarkus-resteasy</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>io.quarkus</groupId>
36+
<artifactId>quarkus-info</artifactId>
37+
</dependency>
38+
<dependency>
39+
<groupId>io.quarkus</groupId>
40+
<artifactId>quarkus-smallrye-health</artifactId>
41+
</dependency>
42+
<dependency>
43+
<groupId>io.quarkus</groupId>
44+
<artifactId>quarkus-smallrye-openapi</artifactId>
45+
</dependency>
46+
<dependency>
47+
<groupId>io.quarkus</groupId>
48+
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
49+
</dependency>
50+
</dependencies>
51+
52+
<build>
53+
<plugins>
54+
<plugin>
55+
<groupId>io.quarkus</groupId>
56+
<artifactId>quarkus-maven-plugin</artifactId>
57+
<version>${quarkus.version}</version>
58+
<executions>
59+
<execution>
60+
<goals>
61+
<goal>build</goal>
62+
</goals>
63+
</execution>
64+
</executions>
65+
</plugin>
66+
</plugins>
67+
</build>
68+
69+
<properties>
70+
<quarkus.version>3.5.0</quarkus.version>
71+
<micrometer.prometheus.version>3.11.0</micrometer.prometheus.version>
72+
</properties>
73+
74+
</project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.baeldung.quarkus;
2+
3+
import jakarta.enterprise.event.Observes;
4+
import jakarta.ws.rs.GET;
5+
import jakarta.ws.rs.Path;
6+
import jakarta.ws.rs.Produces;
7+
import jakarta.ws.rs.core.MediaType;
8+
9+
import io.quarkus.vertx.http.ManagementInterface;
10+
11+
@Path("/hello")
12+
public class GreetingResource {
13+
14+
@GET
15+
@Produces(MediaType.TEXT_PLAIN)
16+
public String hello() {
17+
return "Hello from Quarkus REST";
18+
}
19+
20+
public void registerManagementRoutes(@Observes ManagementInterface mi) {
21+
mi.router()
22+
.get("/q/custom")
23+
.handler(rc -> rc.response()
24+
.end("Custom Management Endpoint Active"));
25+
}
26+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
quarkus.management.enabled=true
2+
quarkus.management.host=localhost
3+
quarkus.management.port=9000
4+
quarkus.management.root-path=/q

0 commit comments

Comments
 (0)