You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Helidon MP version of the "customer" microservice.
3
+
Helidon MP version of the "customer" microservice built using the **Helidon MP profile** for enterprise Java applications with CDI, JPA, and microservices capabilities.
4
4
5
5
## Build and run
6
6
7
+
### Prerequisites
8
+
- JDK 21
9
+
- Maven 3.8+
10
+
11
+
### Building the Application
12
+
13
+
The build process creates a **thin JAR deployment package** as a ZIP file containing the application JAR and all dependencies:
7
14
8
-
With JDK21
9
15
```bash
10
-
mvn package
11
-
java -jar target/customer-helidon.jar
16
+
mvn clean package
12
17
```
13
18
14
-
## Exercise the application
19
+
This creates:
20
+
-`target/customer-helidon.jar` - The thin application JAR
21
+
-`target/customer-helidon-deployment.zip` - Complete deployment package with structure:
22
+
```
23
+
customer-helidon.jar (main application)
24
+
app/
25
+
libs/ (all dependency JARs)
26
+
```
27
+
28
+
### Running the Application
15
29
16
-
Basic:
30
+
**Option 1: Using the thin JAR (requires dependencies in classpath):**
31
+
```bash
32
+
# Extract the deployment ZIP first
33
+
cd target
34
+
unzip customer-helidon-deployment.zip
35
+
java -jar customer-helidon.jar
17
36
```
18
-
curl -X GET http://localhost:8080/simple-greet
19
-
Hello World!
37
+
38
+
**Option 2: Using Maven to run directly:**
39
+
```bash
40
+
mvn exec:java
20
41
```
21
42
43
+
## Quick Start with Local Oracle Database
44
+
45
+
To run against a local Oracle Docker container, simply:
cd target && unzip customer-helidon-deployment.zip
65
+
java -jar customer-helidon.jar
66
+
```
67
+
68
+
The application will automatically create the necessary database tables on startup using Hibernate's DDL auto-generation.
69
+
70
+
### Basic:
71
+
```bash
72
+
curl -X GET http://localhost:8080/simple-greet
73
+
Hello World!
24
74
```
75
+
76
+
### JSON:
77
+
```bash
25
78
curl -X GET http://localhost:8080/greet
26
79
{"message":"Hello World!"}
27
80
@@ -34,61 +87,130 @@ curl -X GET http://localhost:8080/greet/Jose
34
87
{"message":"Hola Jose!"}
35
88
```
36
89
37
-
38
-
39
-
## Try health
40
-
41
-
```
90
+
### Try health
91
+
```bash
42
92
curl -s -X GET http://localhost:8080/health
43
93
{"outcome":"UP",...
44
-
45
94
```
46
95
96
+
### Try metrics
97
+
```bash
98
+
# Prometheus Format
99
+
curl -s -X GET http://localhost:8080/metrics
100
+
# TYPE base:gc_g1_young_generation_count gauge
101
+
...
102
+
103
+
# JSON Format
104
+
curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
105
+
{"base":...
106
+
...
107
+
```
47
108
48
109
## Building a Native Image
49
110
50
111
The generation of native binaries requires an installation of GraalVM 22.1.0+.
51
-
52
112
You can build a native binary using Maven as follows:
53
113
54
-
```
114
+
```bash
55
115
mvn -Pnative-image install -DskipTests
56
116
```
57
117
58
-
The generation of the executable binary may take a few minutes to complete depending on
59
-
your hardware and operating system. When completed, the executable file will be available
60
-
under the `target` directory and be named after the artifact ID you have chosen during the
61
-
project generation phase.
62
-
118
+
The generation of the executable binary may take a few minutes to complete depending on your hardware and operating system. When completed, the executable file will be available under the `target` directory and be named after the artifact ID you have chosen during the project generation phase.
63
119
120
+
## Docker Support
64
121
65
-
## Try metrics
122
+
### Building the Docker Image
123
+
```bash
124
+
docker build -t customer-helidon .
125
+
```
66
126
127
+
### Running the Docker Image
128
+
```bash
129
+
docker run --rm -p 8080:8080 customer-helidon:latest
67
130
```
68
-
# Prometheus Format
69
-
curl -s -X GET http://localhost:8080/metrics
70
-
# TYPE base:gc_g1_young_generation_count gauge
71
-
. . .
72
131
73
-
# JSON Format
74
-
curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
75
-
{"base":...
76
-
. . .
132
+
Exercise the application as described above.
133
+
134
+
## Configuration
135
+
136
+
### Application Properties (`application.yaml`)
137
+
```yaml
138
+
# Microprofile server properties
139
+
server.port=8080
140
+
server.host=0.0.0.0
141
+
# Change the following to true to enable the optional MicroProfile Metrics REST.request metrics
142
+
metrics.rest-request.enabled=false
143
+
144
+
# Application properties. This is the default greeting
0 commit comments