Skip to content

Commit 021c173

Browse files
author
Ixchel Ruiz
committed
Chapter 04 and Chapter 06
1 parent 84cdbee commit 021c173

File tree

77 files changed

+3622
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3622
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.gradle/
2+
*.iml
3+
*.ipr
4+
*.iws
5+
.idea/
6+
build/
7+
out/
8+
target/
9+
.classpath
10+
.project
11+
tmp/
12+
.DS_Store
13+
.tmp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>io.helidon.applications</groupId>
8+
<artifactId>helidon-mp</artifactId>
9+
<version>2.3.0</version>
10+
</parent>
11+
<groupId>com.example</groupId>
12+
<artifactId>demo</artifactId>
13+
<version>1.0-SNAPSHOT</version>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>io.helidon.microprofile.bundles</groupId>
18+
<artifactId>helidon-microprofile</artifactId>
19+
</dependency>
20+
<dependency>
21+
<groupId>org.jboss</groupId>
22+
<artifactId>jandex</artifactId>
23+
<scope>runtime</scope>
24+
<optional>true</optional>
25+
</dependency>
26+
<dependency>
27+
<groupId>jakarta.activation</groupId>
28+
<artifactId>jakarta.activation-api</artifactId>
29+
<scope>runtime</scope>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.junit.jupiter</groupId>
33+
<artifactId>junit-jupiter-api</artifactId>
34+
<scope>test</scope>
35+
</dependency>
36+
</dependencies>
37+
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-dependency-plugin</artifactId>
43+
<executions>
44+
<execution>
45+
<id>copy-libs</id>
46+
</execution>
47+
</executions>
48+
</plugin>
49+
<plugin>
50+
<groupId>org.jboss.jandex</groupId>
51+
<artifactId>jandex-maven-plugin</artifactId>
52+
<executions>
53+
<execution>
54+
<id>make-index</id>
55+
</execution>
56+
</executions>
57+
</plugin>
58+
<plugin>
59+
<groupId>io.helidon.build-tools</groupId>
60+
<artifactId>helidon-maven-plugin</artifactId>
61+
<executions>
62+
<execution>
63+
<id>third-party-license-report</id>
64+
</execution>
65+
</executions>
66+
</plugin>
67+
</plugins>
68+
</build>
69+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# MicroProfile generated Application
2+
3+
## Introduction
4+
5+
MicroProfile Starter has generated this MicroProfile application for you.
6+
7+
The generation of the executable jar file can be performed by issuing the following command
8+
9+
mvn clean package
10+
11+
This will create an executable jar file **demo.jar** within the _target_ maven folder. This can be started by executing the following command
12+
13+
java -jar target/demo.jar
14+
15+
16+
17+
To launch the test page, open your browser at the following URL
18+
19+
http://localhost:8080/index.html
20+
21+
22+
23+
## Specification examples
24+
25+
By default, there is always the creation of a JAX-RS application class to define the path on which the JAX-RS endpoints are available.
26+
27+
Also, a simple Hello world endpoint is created, have a look at the class **HelloController**.
28+
29+
More information on MicroProfile can be found [here](https://microprofile.io/)
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.example.demo;
2+
3+
import io.helidon.common.Reflected;
4+
5+
@Reflected
6+
public class Greeting {
7+
private final String content;
8+
9+
public Greeting(String content) {
10+
this.content = content;
11+
}
12+
13+
public String getContent() {
14+
return content;
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.example.demo;
2+
3+
import javax.ws.rs.DefaultValue;
4+
import javax.ws.rs.GET;
5+
import javax.ws.rs.Path;
6+
import javax.ws.rs.QueryParam;
7+
8+
@Path("/greeting")
9+
public class GreetingResource {
10+
private static final String template = "Hello, %s!";
11+
12+
@GET
13+
public Greeting greeting(@QueryParam("name") @DefaultValue("World") String name) {
14+
return new Greeting(String.format(template, name));
15+
}
16+
}

chapter04-dissecting-the-monolith/helidon-demo/src/main/resources/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
5+
bean-discovery-mode="all">
6+
</beans>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
# Microprofile server properties
3+
server.port=8080
4+
server.host=0.0.0.0
5+
6+
# src/main/resources/WEB in your source tree
7+
server.static.classpath.location=/WEB
8+
# default is index.html
9+
#server.static.classpath.welcome=index.html
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Eclipse MicroProfile demo</title>
6+
</head>
7+
<body>
8+
9+
<h2>MicroProfile</h2>
10+
11+
<a href="data/hello" target="_blank" >Hello JAX-RS endpoint</a> <br/>
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
</body>
32+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Example Logging Configuration File
2+
# For more information see $JAVA_HOME/jre/lib/logging.properties
3+
4+
# Send messages to the console
5+
handlers=java.util.logging.ConsoleHandler
6+
7+
# Global default logging level. Can be overriden by specific handlers and loggers
8+
.level=INFO
9+
10+
# Helidon Web Server has a custom log formatter that extends SimpleFormatter.
11+
# It replaces "!thread!" with the current thread name
12+
java.util.logging.ConsoleHandler.level=INFO
13+
java.util.logging.ConsoleHandler.formatter=io.helidon.webserver.WebServerLogFormatter
14+
java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n
15+
16+
#Component specific log levels
17+
#io.helidon.webserver.level=INFO
18+
#io.helidon.config.level=INFO
19+
#io.helidon.security.level=INFO
20+
#io.helidon.microprofile.level=INFO
21+
#io.helidon.common.level=INFO
22+
#io.netty.level=INFO
23+
#org.glassfish.jersey.level=INFO
24+
#org.jboss.weld=INFO
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-----BEGIN PRIVATE KEY-----
2+
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPAO3J/p486N/+
3+
gQslxfsC4Vct7cAVMi7v3I6mTXDizw+JrpMTRNVUcnVf0ymKIxGHktbnqtFJBfkf
4+
lIdLIxM5PwPB23J0ehklONNq8zGqjFZQI9TU1H3e12Jt7AUn4TKQaPXtBQalybb6
5+
ayT7RhiNNrUGGNzH+wL1ak8jVAEFpLuFcfojJwshF3myNfXInAqRIGCEeQBFyZrh
6+
8RK+PxoGOiYmXJJgxDxtfr0cMVa7y0gdPuSqEDQND+vt8kVQk47cK8eGH1ypoPfk
7+
emeNOpjjDRaJIuoDgXEOCQxHVT1qN4OjWOfAYRZXtfvy6xrP+rS5o0gqg/1tZbF7
8+
XUmrm46vAgMBAAECggEBAMehqrFKF4rAPvzvsDN+ikPN08icZ8lJO1DhUMT7HCnv
9+
7JkoPfiwQlgNhjqip4XrqgUoTI7hArK8yvN0x0FkEy77IYF8RBYmhkeKVQHohXZn
10+
nvnshF24i6cz6l395z79hEkWoE0zsqSCMy+v0tttT1Iod03o/kryPXk2TBnS8qVf
11+
6nv/ohuu2S5KI0b4skxGSM60kA96h6ngCcq4pkwHEtnwJmF2xz4EO+zb558yOF5A
12+
OznjKxTbNH3RsCGG1bMWSvy4qIihdJRDUAeKKdtAZOeLgUrSFHUDxKwCLFIESde0
13+
JP9uXuUlAb8WOnsL4z0jbgx1+ctI0UOIKTJc8sErXrECgYEA+S8cSpgED416ydrt
14+
WWmETeW2sPUJsmDfQhQxUoxhSypDTDBGHGBZzvLSoWCxJBnuY8teiDzDAXh7nHMs
15+
SZA1vT9hZu+qWzgdU+0SK6r0FyY5RFBIHB468fO6S5mJm0wqmy1J94Voaeofij1q
16+
1pE8/tniLKciP2BnkX7lu2F1E4cCgYEA1Kp0Kz0WwUcu2UnmKOOzqIsA9mwucKAF
17+
zmGA1c8q+Cx2dIgeHQjWtl3SWs0qVps74YEZUYbxmG/M9MHHGbRq7w8hwaSpeFt+
18+
DswiscELag4PuEHn6yGdJyPnXBoERnOvVPlkdDts6NPvLtfcBBkgPqhpvhObf9vf
19+
Cv+trWWExZkCgYAlmY86Tj/mnOGXTdqcsEhPfMcZYpApA2cM0IE0xIv1zJXFDE+3
20+
/m3uxUM1KKLyIJuRIWHNSuXd9fEpBVP8ca86NDMdVjKtewUp4c7pGe2lBJaFkVug
21+
KouYcL9+otdZwJ95NNdBazb7LGG/+U6Cu/2pMvVm6X1IdOKL2MsPgEArRwKBgQDA
22+
midfyZHENg2t6Qmz2pUpfcq/YrakdakMgq3F9jw6Szp0y5pKPWkH/Oy4I7vGeAzB
23+
bMRbW9WOcyKyQJVrKET4gUHXOKPrRyFhkWuShP0rbdS60aWTA/xqKFAuz7kzfS47
24+
zSo3QmKecuLaD9FJPOBBHxG1fdiE8cKNGYZX1etrcQKBgHhnkwmCTxXdimQTswE1
25+
nytAbdXEUSqLU2sZT3sQq497j6uOjcBlZekPtibOuyQLFmeKIMZMI1j0AARbu+ZJ
26+
T7SwLL4cjsws838VujJzXPGxvbp3twvWpZHsUvp2eX/8LiWexL5TPj4jkHkkholH
27+
H675T5VXIbt4N8LR1fHThOJB
28+
-----END PRIVATE KEY-----
237 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"Role": {
3+
"Path": "/",
4+
"RoleName": "lambda-ex",
5+
"RoleId": "AROAZEJV7ZLPCZ7CNYW6U",
6+
"Arn": "arn:aws:iam::627715328734:role/lambda-ex",
7+
"CreateDate": "2021-06-13T15:22:56+00:00",
8+
"AssumeRolePolicyDocument": {
9+
"Version": "2012-10-17",
10+
"Statement": [
11+
{
12+
"Effect": "Allow",
13+
"Principal": {
14+
"Service": "lambda.amazonaws.com"
15+
},
16+
"Action": "sts:AssumeRole"
17+
}
18+
]
19+
}
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Bill",
3+
"greeting": "hello"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>com.example.demo</groupId>
7+
<artifactId>quarkus-lambda</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
<properties>
10+
<compiler-plugin.version>3.8.1</compiler-plugin.version>
11+
<maven.compiler.parameters>true</maven.compiler.parameters>
12+
<maven.compiler.target>11</maven.compiler.target>
13+
<maven.compiler.source>11</maven.compiler.source>
14+
<maven.compiler.release>11</maven.compiler.release>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
17+
<quarkus-plugin.version>1.13.7.Final</quarkus-plugin.version>
18+
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
19+
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
20+
<quarkus.platform.version>1.13.7.Final</quarkus.platform.version>
21+
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
22+
</properties>
23+
<dependencyManagement>
24+
<dependencies>
25+
<dependency>
26+
<groupId>${quarkus.platform.group-id}</groupId>
27+
<artifactId>${quarkus.platform.artifact-id}</artifactId>
28+
<version>${quarkus.platform.version}</version>
29+
<type>pom</type>
30+
<scope>import</scope>
31+
</dependency>
32+
</dependencies>
33+
</dependencyManagement>
34+
<dependencies>
35+
<dependency>
36+
<groupId>io.quarkus</groupId>
37+
<artifactId>quarkus-amazon-lambda</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>io.quarkus</groupId>
41+
<artifactId>quarkus-test-amazon-lambda</artifactId>
42+
<scope>test</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>io.quarkus</groupId>
46+
<artifactId>quarkus-junit5</artifactId>
47+
<scope>test</scope>
48+
</dependency>
49+
</dependencies>
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>io.quarkus</groupId>
54+
<artifactId>quarkus-maven-plugin</artifactId>
55+
<version>${quarkus-plugin.version}</version>
56+
<executions>
57+
<execution>
58+
<goals>
59+
<goal>build</goal>
60+
</goals>
61+
</execution>
62+
</executions>
63+
</plugin>
64+
<plugin>
65+
<artifactId>maven-compiler-plugin</artifactId>
66+
<version>${compiler-plugin.version}</version>
67+
</plugin>
68+
<plugin>
69+
<artifactId>maven-surefire-plugin</artifactId>
70+
<version>${surefire-plugin.version}</version>
71+
<configuration>
72+
<systemPropertyVariables>
73+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
74+
<maven.home>${maven.home}</maven.home>
75+
</systemPropertyVariables>
76+
</configuration>
77+
</plugin>
78+
</plugins>
79+
</build>
80+
<profiles>
81+
<profile>
82+
<id>native</id>
83+
<activation>
84+
<property>
85+
<name>native</name>
86+
</property>
87+
</activation>
88+
<properties>
89+
<quarkus.package.type>native</quarkus.package.type>
90+
</properties>
91+
</profile>
92+
</profiles>
93+
</project>

0 commit comments

Comments
 (0)