├── ai
├── README.md
├── src
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── ai
│ │ │ └── AiApplicationTests.java
│ └── main
│ │ ├── resources
│ │ ├── my-system-prompt.md
│ │ ├── application.properties
│ │ ├── schema.sql
│ │ └── data.sql
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── ai
│ │ └── AiApplication.java
├── compose.yaml
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── pom.xml
└── mvnw.cmd
├── .gitignore
├── aot
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── message
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── aot
│ │ │ └── AotApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── aot
│ │ └── AotApplicationTests.java
├── native.sh
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── pom.xml
└── mvnw.cmd
├── microservices
├── config
│ ├── service-a.properties
│ ├── service-b.properties
│ ├── application.properties
│ └── .DS_Store
├── .DS_Store
├── service-a
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ └── application.properties
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── service_a
│ │ │ │ └── ServiceAApplication.java
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── service_a
│ │ │ └── ServiceAApplicationTests.java
│ ├── .gitignore
│ ├── .mvn
│ │ └── wrapper
│ │ │ └── maven-wrapper.properties
│ └── pom.xml
├── service-b
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ └── application.properties
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── service_b
│ │ │ │ └── ServiceBApplication.java
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── service_b
│ │ │ └── ServiceBApplicationTests.java
│ ├── .gitignore
│ ├── .mvn
│ │ └── wrapper
│ │ │ └── maven-wrapper.properties
│ └── pom.xml
├── service-registry
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ └── application.properties
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── service_registry
│ │ │ │ └── ServiceRegistryApplication.java
│ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── service_registry
│ │ │ └── ServiceRegistryApplicationTests.java
│ ├── .gitignore
│ ├── .mvn
│ │ └── wrapper
│ │ │ └── maven-wrapper.properties
│ └── pom.xml
└── config-server
│ ├── src
│ ├── main
│ │ ├── resources
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── config_server
│ │ │ └── ConfigServerApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── config_server
│ │ └── ConfigServerApplicationTests.java
│ ├── .gitignore
│ ├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
│ └── pom.xml
├── integration
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── integration
│ │ │ └── IntegrationApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── integration
│ │ └── IntegrationApplicationTests.java
├── compose.yaml
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
└── pom.xml
├── beans
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── application.properties
│ │ │ └── beans.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── beans
│ │ │ └── BeansApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── beans
│ │ └── BeansApplicationTests.java
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── pom.xml
└── mvnw.cmd
├── web
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── application.properties
│ │ │ └── graphql
│ │ │ │ └── schema.graphqls
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── web
│ │ │ ├── Order.java
│ │ │ ├── OrderService.java
│ │ │ ├── WebApplication.java
│ │ │ ├── OrderRestController.java
│ │ │ ├── OrderGraphqlController.java
│ │ │ └── Clients.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── web
│ │ └── WebApplicationTests.java
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── pom.xml
└── mvnw.cmd
├── development-desk-check
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── development_desk_check
│ │ │ └── DevelopmentDeskCheckApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── development_desk_check
│ │ └── DevelopmentDeskCheckApplicationTests.java
├── .envrc
├── .sdkmanrc
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
└── pom.xml
├── data-oriented-programming
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── data_oriented_programming
│ │ │ └── DataOrientedProgrammingApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── data_oriented_programming
│ │ └── DataOrientedProgrammingApplicationTests.java
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
└── pom.xml
├── data
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── db
│ │ │ │ └── migration
│ │ │ │ │ ├── V3__line_item_id.sql
│ │ │ │ │ ├── V1__baseline.sql
│ │ │ │ │ └── V2__data.sql
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── data
│ │ │ └── DataApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── data
│ │ └── DataApplicationTests.java
├── compose.yaml
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── pom.xml
└── mvnw.cmd
├── modularity
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── data.sql
│ │ │ ├── schema.sql
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── modularity
│ │ │ ├── adoptions
│ │ │ ├── DogAdoptionEvent.java
│ │ │ └── DogAdoptionController.java
│ │ │ ├── ModularityApplication.java
│ │ │ └── vet
│ │ │ └── Dogtor.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── modularity
│ │ └── ModularityApplicationTests.java
├── compose.yaml
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
└── pom.xml
├── batch
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── input.csv
│ │ │ ├── schema.sql
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── batch
│ │ │ └── BatchApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── batch
│ │ └── BatchApplicationTests.java
├── compose.yaml
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── pom.xml
└── mvnw.cmd
├── basics
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── data.sql
│ │ │ ├── schema.sql
│ │ │ ├── application.properties
│ │ │ └── banner.txt
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── basics
│ │ │ └── BasicsApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── basics
│ │ ├── TestBasicsApplication.java
│ │ ├── BasicsApplicationTests.java
│ │ └── TestcontainersConfiguration.java
├── compose.yaml
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── pom.xml
└── mvnw.cmd
├── scalability
├── src
│ ├── main
│ │ ├── resources
│ │ │ └── application.properties
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── scalability
│ │ │ └── ScalabilityApplication.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── scalability
│ │ └── ScalabilityApplicationTests.java
├── .gitignore
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
└── pom.xml
├── security
├── resource-server
│ ├── src
│ │ ├── main
│ │ │ ├── resources
│ │ │ │ └── application.properties
│ │ │ └── java
│ │ │ │ └── bootiful
│ │ │ │ └── resource_server
│ │ │ │ └── ResourceServerApplication.java
│ │ └── test
│ │ │ └── java
│ │ │ └── bootiful
│ │ │ └── resource_server
│ │ │ └── ResourceServerApplicationTests.java
│ ├── .gitignore
│ ├── .mvn
│ │ └── wrapper
│ │ │ └── maven-wrapper.properties
│ └── pom.xml
├── misc
│ ├── init_db.sh
│ └── legacy-schema.sql
├── passwordless
│ ├── compose.yaml
│ ├── src
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── bootiful
│ │ │ │ └── passwordless
│ │ │ │ └── PasswordlessApplicationTests.java
│ │ └── main
│ │ │ ├── resources
│ │ │ └── application.yml
│ │ │ └── java
│ │ │ └── bootiful
│ │ │ └── passwordless
│ │ │ └── PasswordlessApplication.java
│ ├── .gitignore
│ ├── .mvn
│ │ └── wrapper
│ │ │ └── maven-wrapper.properties
│ └── pom.xml
└── oauth-login
│ ├── src
│ ├── test
│ │ └── java
│ │ │ └── bootiful
│ │ │ └── oauth_login
│ │ │ └── OauthLoginApplicationTests.java
│ └── main
│ │ ├── resources
│ │ └── application.yml
│ │ └── java
│ │ └── bootiful
│ │ └── oauth_login
│ │ └── OauthLoginApplication.java
│ ├── .gitignore
│ ├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
│ └── pom.xml
└── README.md
/ai/README.md:
--------------------------------------------------------------------------------
1 | # README
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | .idea
3 |
--------------------------------------------------------------------------------
/aot/src/main/resources/message:
--------------------------------------------------------------------------------
1 | hello, world!
--------------------------------------------------------------------------------
/microservices/config/service-a.properties:
--------------------------------------------------------------------------------
1 | server.port=8081
2 |
--------------------------------------------------------------------------------
/microservices/config/service-b.properties:
--------------------------------------------------------------------------------
1 | server.port=8082
2 |
--------------------------------------------------------------------------------
/aot/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=aot
2 |
--------------------------------------------------------------------------------
/integration/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=integration
2 |
--------------------------------------------------------------------------------
/beans/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=beans
2 | bootiful.name=Bob
--------------------------------------------------------------------------------
/microservices/config/application.properties:
--------------------------------------------------------------------------------
1 | message=hello, spring cloud config server (application)
--------------------------------------------------------------------------------
/aot/native.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ./mvnw -DskipTests -Pnative native:compile
4 | ./target/aot
--------------------------------------------------------------------------------
/web/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=web
2 | spring.graphql.graphiql.enabled=true
--------------------------------------------------------------------------------
/development-desk-check/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=development-desk-check
2 |
--------------------------------------------------------------------------------
/data-oriented-programming/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=data-oriented-programming
2 |
--------------------------------------------------------------------------------
/data/src/main/resources/db/migration/V3__line_item_id.sql:
--------------------------------------------------------------------------------
1 | alter table line_item add column id serial primary key not null ;
--------------------------------------------------------------------------------
/development-desk-check/.envrc:
--------------------------------------------------------------------------------
1 | #export KEY=123
2 | export KEY=$( bw get item bootiful-workshop-demo-key | jq -r '.notes' )
3 |
--------------------------------------------------------------------------------
/microservices/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joshlong-attic/2024-bootiful-spring-workshop/HEAD/microservices/.DS_Store
--------------------------------------------------------------------------------
/modularity/src/main/resources/data.sql:
--------------------------------------------------------------------------------
1 | delete from dog;
2 | insert into dog (id , name, owner) values ( 45, 'Prancer', null);
--------------------------------------------------------------------------------
/batch/src/main/resources/input.csv:
--------------------------------------------------------------------------------
1 | id,name
2 | 1,madhura
3 | 2,juergen
4 | 3,olga
5 | 4,dave
6 | 5,violetta
7 | 6,stephane
8 | 7,josh
--------------------------------------------------------------------------------
/microservices/service-a/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=service-a
2 | spring.config.import=configserver:
--------------------------------------------------------------------------------
/microservices/config/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joshlong-attic/2024-bootiful-spring-workshop/HEAD/microservices/config/.DS_Store
--------------------------------------------------------------------------------
/microservices/service-b/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=service-b
2 | spring.config.import=configserver:
3 |
--------------------------------------------------------------------------------
/basics/src/main/resources/data.sql:
--------------------------------------------------------------------------------
1 | delete from customer;
2 | insert into customer(name) values ('Madhura');
3 | insert into customer(name) values ('Juergen');
--------------------------------------------------------------------------------
/basics/src/main/resources/schema.sql:
--------------------------------------------------------------------------------
1 | create table if not exists customer
2 | (
3 | id serial primary key,
4 | name text not null
5 | );
6 |
7 |
--------------------------------------------------------------------------------
/development-desk-check/.sdkmanrc:
--------------------------------------------------------------------------------
1 | # Enable auto-env through the sdkman_auto_env config
2 | # Add key=value pairs of SDKs to use below
3 | java=23-graalce
4 |
--------------------------------------------------------------------------------
/basics/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=basics
2 | spring.docker.compose.lifecycle-management=start_only
3 | spring.sql.init.mode=always
--------------------------------------------------------------------------------
/scalability/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=scalability
2 |
3 | server.tomcat.threads.max=10
4 | spring.threads.virtual.enabled=true
--------------------------------------------------------------------------------
/batch/src/main/resources/schema.sql:
--------------------------------------------------------------------------------
1 | create table if not exists customer
2 | (
3 | id serial primary key,
4 | name text not null
5 | ) ;
6 | delete from customer;
--------------------------------------------------------------------------------
/modularity/src/main/resources/schema.sql:
--------------------------------------------------------------------------------
1 | create table if not exists dog
2 | (
3 | id serial primary key,
4 | name text not null,
5 | owner text null
6 | );
--------------------------------------------------------------------------------
/web/src/main/java/com/example/web/Order.java:
--------------------------------------------------------------------------------
1 | package com.example.web;
2 |
3 | record Order(int id, String sku, float price) {
4 | }
5 |
6 | record LineItem(int id) {
7 | }
--------------------------------------------------------------------------------
/security/resource-server/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=resource-server
2 | server.port=9091
3 | spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8080
--------------------------------------------------------------------------------
/data/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=data
2 | spring.datasource.password=secret
3 | spring.datasource.username=myuser
4 | spring.datasource.url=jdbc:postgresql://localhost/mydatabase
--------------------------------------------------------------------------------
/microservices/service-registry/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=service-registry
2 | server.port=8761
3 | eureka.client.register-with-eureka=false
4 | eureka.client.fetch-registry=false
--------------------------------------------------------------------------------
/integration/compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | rabbitmq:
3 | image: 'rabbitmq:latest'
4 | environment:
5 | - 'RABBITMQ_DEFAULT_PASS=secret'
6 | - 'RABBITMQ_DEFAULT_USER=myuser'
7 | ports:
8 | - '5672:5672'
9 |
--------------------------------------------------------------------------------
/basics/compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | postgres:
3 | image: 'postgres:latest'
4 | environment:
5 | - 'POSTGRES_DB=mydatabase'
6 | - 'POSTGRES_PASSWORD=secret'
7 | - 'POSTGRES_USER=myuser'
8 | ports:
9 | - '5432:5432'
10 |
--------------------------------------------------------------------------------
/batch/compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | postgres:
3 | image: 'postgres:latest'
4 | environment:
5 | - 'POSTGRES_DB=mydatabase'
6 | - 'POSTGRES_PASSWORD=secret'
7 | - 'POSTGRES_USER=myuser'
8 | ports:
9 | - '5432:5432'
10 |
--------------------------------------------------------------------------------
/data/compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | postgres:
3 | image: 'postgres:latest'
4 | environment:
5 | - 'POSTGRES_DB=mydatabase'
6 | - 'POSTGRES_PASSWORD=secret'
7 | - 'POSTGRES_USER=myuser'
8 | ports:
9 | - '5432:5432'
10 |
--------------------------------------------------------------------------------
/security/misc/init_db.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | cat `dirname $0`/legacy-schema.sql | PGPASSWORD=secret psql -U myuser -h localhost mydatabase
3 |
4 | # if you want to use the SQL then remember to run:
5 | # update users set password = '{sha256}' || password ;
--------------------------------------------------------------------------------
/modularity/compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | postgres:
3 | image: 'postgres:latest'
4 | environment:
5 | - 'POSTGRES_DB=mydatabase'
6 | - 'POSTGRES_PASSWORD=secret'
7 | - 'POSTGRES_USER=myuser'
8 | ports:
9 | - '5432:5432'
10 |
--------------------------------------------------------------------------------
/modularity/src/main/java/com/example/modularity/adoptions/DogAdoptionEvent.java:
--------------------------------------------------------------------------------
1 | package com.example.modularity.adoptions;
2 |
3 | import org.springframework.modulith.events.Externalized;
4 |
5 | @Externalized
6 | public record DogAdoptionEvent (int dogId) {
7 | }
8 |
--------------------------------------------------------------------------------
/security/passwordless/compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | postgres:
3 | image: 'postgres:latest'
4 | environment:
5 | - 'POSTGRES_DB=mydatabase'
6 | - 'POSTGRES_PASSWORD=secret'
7 | - 'POSTGRES_USER=myuser'
8 | ports:
9 | - '5432:5432'
10 |
--------------------------------------------------------------------------------
/microservices/config-server/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=config-server
2 | #
3 | server.port=8888
4 | spring.cloud.config.server.git.uri=https://github.com/joshlong-attic/2024-bootiful-spring-workshop.git
5 | spring.cloud.config.server.git.search-paths=microservices/config
--------------------------------------------------------------------------------
/ai/src/test/java/com/example/ai/AiApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.ai;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class AiApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/data/src/main/resources/db/migration/V1__baseline.sql:
--------------------------------------------------------------------------------
1 | create table if not exists customer
2 | (
3 | id serial primary key not null ,
4 | name text not null
5 | );
6 |
7 | create table if not exists line_item
8 | (
9 | customer bigint references customer (id),
10 | sku text not null
11 | );
--------------------------------------------------------------------------------
/aot/src/test/java/com/example/aot/AotApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.aot;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class AotApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/web/src/test/java/com/example/web/WebApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.web;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class WebApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/data/src/test/java/com/example/data/DataApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.data;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class DataApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/batch/src/test/java/com/example/batch/BatchApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.batch;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class BatchApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/beans/src/test/java/com/example/beans/BeansApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.beans;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class BeansApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/ai/compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | pgvector:
3 | image: 'pgvector/pgvector:pg16'
4 | environment:
5 | - 'POSTGRES_DB=mydatabase'
6 | - 'POSTGRES_PASSWORD=secret'
7 | - 'POSTGRES_USER=myuser'
8 | labels:
9 | - "org.springframework.boot.service-connection=postgres"
10 | ports:
11 | - '5432:5432'
--------------------------------------------------------------------------------
/batch/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=batch
2 | #
3 | spring.datasource.url=jdbc:postgresql://localhost/mydatabase
4 | spring.datasource.username=myuser
5 | spring.datasource.password=secret
6 | #
7 | init-schema=always
8 | spring.batch.jdbc.initialize-schema=${init-schema}
9 | spring.sql.init.mode=${init-schema}
--------------------------------------------------------------------------------
/modularity/src/test/java/com/example/modularity/ModularityApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.modularity;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class ModularityApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/integration/src/test/java/com/example/integration/IntegrationApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.integration;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class IntegrationApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/scalability/src/test/java/com/example/scalability/ScalabilityApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.scalability;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class ScalabilityApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/microservices/service-a/src/test/java/com/example/service_a/ServiceAApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.service_a;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class ServiceAApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/microservices/service-b/src/test/java/com/example/service_b/ServiceBApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.service_b;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class ServiceBApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/security/oauth-login/src/test/java/bootiful/oauth_login/OauthLoginApplicationTests.java:
--------------------------------------------------------------------------------
1 | package bootiful.oauth_login;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class OauthLoginApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/security/passwordless/src/test/java/bootiful/passwordless/PasswordlessApplicationTests.java:
--------------------------------------------------------------------------------
1 | package bootiful.passwordless;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class PasswordlessApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/basics/src/test/java/com/example/basics/TestBasicsApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.basics;
2 |
3 | import org.springframework.boot.SpringApplication;
4 |
5 | public class TestBasicsApplication {
6 |
7 | public static void main(String[] args) {
8 | SpringApplication.from(BasicsApplication::main).with(TestcontainersConfiguration.class).run(args);
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/microservices/config-server/src/test/java/com/example/config_server/ConfigServerApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.config_server;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class ConfigServerApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/security/resource-server/src/test/java/bootiful/resource_server/ResourceServerApplicationTests.java:
--------------------------------------------------------------------------------
1 | package bootiful.resource_server;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class ResourceServerApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/ai/src/main/resources/my-system-prompt.md:
--------------------------------------------------------------------------------
1 | You are an AI powered assistant to help people adopt a dog
2 | from the adoption agency named Pooch Palace with locations in
3 | Seoul, Tokyo, Singapore, Paris, Mumbai, New Delhi, San Francisco,
4 | and London. If you don't know about the dogs housed at our particular
5 | stores, then return a disappointed response suggesting we don't
6 | have any dogs available.
--------------------------------------------------------------------------------
/microservices/service-registry/src/test/java/com/example/service_registry/ServiceRegistryApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.service_registry;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class ServiceRegistryApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/development-desk-check/src/test/java/com/example/development_desk_check/DevelopmentDeskCheckApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.development_desk_check;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class DevelopmentDeskCheckApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/modularity/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=modularity
2 | #
3 | spring.modulith.republish-outstanding-events-on-restart=true
4 | spring.modulith.events.jdbc.schema-initialization.enabled=true
5 | #
6 | spring.datasource.password=secret
7 | spring.datasource.username=myuser
8 | spring.datasource.url=jdbc:postgresql://localhost/mydatabase
9 | #
10 | spring.sql.init.mode=always
--------------------------------------------------------------------------------
/ai/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=ai
2 | #export SPRING_AI_OPENAI_IMAGE_API_KEY=...
3 | spring.ai.openai.chat.options.model=gpt-4o
4 | #spring.ai.vectorstore.pgvector.initialize-schema=true
5 | #
6 | spring.datasource.url=jdbc:postgresql://localhost/mydatabase
7 | spring.datasource.username=myuser
8 | spring.datasource.password=secret
9 | #
10 | spring.sql.init.mode=always
11 | #
12 |
--------------------------------------------------------------------------------
/data-oriented-programming/src/test/java/com/example/data_oriented_programming/DataOrientedProgrammingApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.data_oriented_programming;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 |
6 | @SpringBootTest
7 | class DataOrientedProgrammingApplicationTests {
8 |
9 | @Test
10 | void contextLoads() {
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/web/src/main/resources/graphql/schema.graphqls:
--------------------------------------------------------------------------------
1 | type Mutation {
2 | create(id:Int, sku:String , price:Float):Order
3 | }
4 |
5 | type Order {
6 | id : Int
7 | date : String
8 | sku : String
9 | price : Float
10 | lineItems: [LineItem]
11 | }
12 |
13 | type LineItem {
14 | id: Int
15 | }
16 |
17 | type Query {
18 |
19 | all : [Order]
20 |
21 | id (id:Int): Order
22 |
23 |
24 | }
--------------------------------------------------------------------------------
/basics/src/test/java/com/example/basics/BasicsApplicationTests.java:
--------------------------------------------------------------------------------
1 | package com.example.basics;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.springframework.boot.test.context.SpringBootTest;
5 | import org.springframework.context.annotation.Import;
6 |
7 | @Import(TestcontainersConfiguration.class)
8 | @SpringBootTest
9 | class BasicsApplicationTests {
10 |
11 | @Test
12 | void contextLoads() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/security/oauth-login/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 9090
3 | spring:
4 | security:
5 | oauth2:
6 | client:
7 | registration:
8 | spring:
9 | client-secret: spring
10 | client-id: spring
11 | scope:
12 | - openid
13 | - profile
14 | provider:
15 | spring:
16 | issuer-uri: http://localhost:8080
--------------------------------------------------------------------------------
/modularity/src/main/java/com/example/modularity/ModularityApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.modularity;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class ModularityApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(ModularityApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/ai/src/main/resources/schema.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE if not exists dog
2 | (
3 | id serial primary key ,
4 | name text NOT NULL,
5 | description text NOT NULL,
6 | dob date NOT NULL,
7 | owner text,
8 | gender character(1) DEFAULT 'f'::bpchar NOT NULL,
9 | image text NOT NULL
10 | );
11 |
12 |
13 |
--------------------------------------------------------------------------------
/data/src/main/resources/db/migration/V2__data.sql:
--------------------------------------------------------------------------------
1 | insert into customer(name) values ('Josh');
2 | insert into customer(name) values ('Juergen');
3 |
4 | insert into line_item( customer, sku)
5 | values ( ( select id from customer where name ='Josh') ,'123' );
6 |
7 | insert into line_item( customer, sku)
8 | values ( ( select id from customer where name ='Josh') ,'456' );
9 |
10 | insert into line_item( customer, sku)
11 | values ( ( select id from customer where name ='Juergen') ,'123' );
--------------------------------------------------------------------------------
/beans/src/main/resources/beans.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/modularity/src/main/java/com/example/modularity/vet/Dogtor.java:
--------------------------------------------------------------------------------
1 | package com.example.modularity.vet;
2 |
3 | import com.example.modularity.adoptions.DogAdoptionEvent;
4 | import org.springframework.context.event.EventListener;
5 | import org.springframework.stereotype.Component;
6 |
7 | @Component
8 | class Dogtor {
9 |
10 | @EventListener
11 | void dogAdoptedEvent (DogAdoptionEvent dogAdoptionEvent) {
12 | System.out.println("checking up on the health of the dog [" +
13 | dogAdoptionEvent +"]");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ai/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/aot/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/basics/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/batch/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/beans/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/data/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/web/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/integration/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/modularity/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/scalability/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/microservices/config-server/src/main/java/com/example/config_server/ConfigServerApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.config_server;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.config.server.EnableConfigServer;
6 |
7 | @EnableConfigServer
8 | @SpringBootApplication
9 | public class ConfigServerApplication {
10 |
11 | public static void main(String[] args) {
12 | SpringApplication.run(ConfigServerApplication.class, args);
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/security/oauth-login/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/security/passwordless/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/data-oriented-programming/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/development-desk-check/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/microservices/service-a/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/microservices/service-b/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/security/resource-server/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/microservices/config-server/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/microservices/service-registry/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/microservices/service-registry/src/main/java/com/example/service_registry/ServiceRegistryApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.service_registry;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
6 |
7 | @EnableEurekaServer
8 | @SpringBootApplication
9 | public class ServiceRegistryApplication {
10 |
11 | public static void main(String[] args) {
12 | SpringApplication.run(ServiceRegistryApplication.class, args);
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/basics/src/test/java/com/example/basics/TestcontainersConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.example.basics;
2 |
3 | import org.springframework.boot.test.context.TestConfiguration;
4 | import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
5 | import org.springframework.context.annotation.Bean;
6 | import org.testcontainers.containers.PostgreSQLContainer;
7 | import org.testcontainers.utility.DockerImageName;
8 |
9 | @TestConfiguration(proxyBeanMethods = false)
10 | class TestcontainersConfiguration {
11 |
12 | @Bean
13 | @ServiceConnection
14 | PostgreSQLContainer> postgresContainer() {
15 | return new PostgreSQLContainer<>(DockerImageName.parse("postgres:latest"));
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/security/passwordless/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | security:
3 | oauth2:
4 | authorizationserver:
5 | client:
6 | oidc-client:
7 | registration:
8 | client-id: "spring"
9 | client-secret: "{noop}spring"
10 | client-authentication-methods:
11 | - "client_secret_basic"
12 | authorization-grant-types:
13 | - "authorization_code"
14 | - "refresh_token"
15 | redirect-uris:
16 | - "http://127.0.0.1:9090/login/oauth2/code/spring"
17 | scopes:
18 | - "openid"
19 | - "profile"
20 | application:
21 | name: passwordless
22 | datasource:
23 | url: jdbc:postgresql://localhost/mydatabase
24 | username: myuser
25 | password: secret
--------------------------------------------------------------------------------
/development-desk-check/src/main/java/com/example/development_desk_check/DevelopmentDeskCheckApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.development_desk_check;
2 |
3 | import org.springframework.boot.ApplicationRunner;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.core.env.Environment;
8 |
9 | @SpringBootApplication
10 | public class DevelopmentDeskCheckApplication {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(DevelopmentDeskCheckApplication.class, args);
14 | }
15 |
16 | @Bean
17 | ApplicationRunner demo(Environment environment) {
18 | return _ -> System.out.println("you've been Juergenized, " + environment.getProperty("user.name")
19 | + ", and your key is " + environment.getProperty("key") + "!");
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/security/resource-server/src/main/java/bootiful/resource_server/ResourceServerApplication.java:
--------------------------------------------------------------------------------
1 | package bootiful.resource_server;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.stereotype.Controller;
6 | import org.springframework.web.bind.annotation.GetMapping;
7 | import org.springframework.web.bind.annotation.ResponseBody;
8 |
9 | import java.security.Principal;
10 | import java.util.Map;
11 |
12 | @SpringBootApplication
13 | public class ResourceServerApplication {
14 |
15 | public static void main(String[] args) {
16 | SpringApplication.run(ResourceServerApplication.class, args);
17 | }
18 |
19 | }
20 |
21 | @Controller
22 | @ResponseBody
23 | class ClientController {
24 |
25 | @GetMapping("/")
26 | Map hello(Principal principal) {
27 | return Map.of("message", "hello from the resource server, " + principal.getName());
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/web/src/main/java/com/example/web/OrderService.java:
--------------------------------------------------------------------------------
1 | package com.example.web;
2 |
3 | import org.springframework.stereotype.Service;
4 |
5 | import java.util.Collection;
6 | import java.util.Map;
7 | import java.util.UUID;
8 | import java.util.concurrent.ConcurrentHashMap;
9 |
10 | @Service
11 | class OrderService {
12 |
13 | private final Map orders = new ConcurrentHashMap<>();
14 |
15 | OrderService() {
16 | this.orders.putAll(Map.of(1, newOrder(1), 2, newOrder(2)));
17 | }
18 |
19 | Collection getAll() {
20 | return this.orders.values();
21 | }
22 |
23 | Order getById(int id) {
24 | return this.orders.get(id);
25 | }
26 |
27 | Order create(Order order) {
28 | this.orders.put(order.id(), order);
29 | return order;
30 | }
31 |
32 | private static Order newOrder(int id) {
33 | return new Order(id, UUID.randomUUID().toString(),
34 | (float) (Math.random() * 100));
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/ai/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/aot/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/data-oriented-programming/src/main/java/com/example/data_oriented_programming/DataOrientedProgrammingApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.data_oriented_programming;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class DataOrientedProgrammingApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(DataOrientedProgrammingApplication.class, args);
11 | }
12 |
13 | }
14 |
15 | class Loans {
16 |
17 | String displayMessageFor(Loan loan) {
18 | return switch (loan) {
19 | case UnsecuredLoan(var interest) -> "ouch! that " + interest + "% rate is going to hurt!";
20 | case SecuredLoan sl -> "good job! nice loan.";
21 | };
22 | }
23 | }
24 |
25 | sealed interface Loan permits SecuredLoan, UnsecuredLoan {
26 | }
27 |
28 | final class SecuredLoan implements Loan {
29 | }
30 |
31 | record UnsecuredLoan(float interest) implements Loan {
32 | }
--------------------------------------------------------------------------------
/web/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/basics/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/batch/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/beans/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/data/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/integration/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/modularity/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/scalability/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/development-desk-check/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/microservices/service-a/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/microservices/service-b/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/security/oauth-login/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # https://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
20 |
--------------------------------------------------------------------------------
/security/passwordless/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # https://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
20 |
--------------------------------------------------------------------------------
/data-oriented-programming/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/microservices/config-server/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/security/resource-server/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # https://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
20 |
--------------------------------------------------------------------------------
/microservices/service-registry/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
20 |
--------------------------------------------------------------------------------
/microservices/service-b/src/main/java/com/example/service_b/ServiceBApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.service_b;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.GetMapping;
8 | import org.springframework.web.bind.annotation.ResponseBody;
9 |
10 | import java.util.Map;
11 |
12 | @SpringBootApplication
13 | public class ServiceBApplication {
14 |
15 | public static void main(String[] args) {
16 | SpringApplication.run(ServiceBApplication.class, args);
17 | }
18 |
19 | }
20 |
21 | @Controller
22 | @ResponseBody
23 | class ProducerController {
24 |
25 | private final String value;
26 |
27 | ProducerController(@Value("${message}") String value) {
28 | this.value = value;
29 | }
30 |
31 | @GetMapping("/answer")
32 | Map answer() {
33 | return Map.of("message", this.value);
34 | }
35 | }
--------------------------------------------------------------------------------
/web/src/main/java/com/example/web/WebApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.web;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.web.servlet.function.HandlerFunction;
7 | import org.springframework.web.servlet.function.RouterFunction;
8 | import org.springframework.web.servlet.function.ServerRequest;
9 | import org.springframework.web.servlet.function.ServerResponse;
10 |
11 | import java.util.Map;
12 |
13 | import static org.springframework.web.servlet.function.RouterFunctions.route;
14 |
15 | @SpringBootApplication
16 | public class WebApplication {
17 |
18 | public static void main(String[] args) {
19 | SpringApplication.run(WebApplication.class, args);
20 | }
21 |
22 | @Bean
23 | RouterFunction httpRequest() {
24 | return route()
25 | .GET("/hello", _ -> ServerResponse.ok().body(Map.of("message", "Hello World")))
26 | .build();
27 | }
28 | }
29 |
30 |
31 |
--------------------------------------------------------------------------------
/data/src/main/java/com/example/data/DataApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.data;
2 |
3 | import org.springframework.boot.ApplicationRunner;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.data.annotation.Id;
8 | import org.springframework.data.repository.CrudRepository;
9 |
10 | import java.util.Collection;
11 | import java.util.Set;
12 |
13 | @SpringBootApplication
14 | public class DataApplication {
15 |
16 | public static void main(String[] args) {
17 | SpringApplication.run(DataApplication.class, args);
18 | }
19 |
20 | @Bean
21 | ApplicationRunner runner(CustomerRepository repository) {
22 | return _ -> repository.findAll().forEach(System.out::println);
23 | }
24 | }
25 |
26 | interface CustomerRepository extends CrudRepository {
27 | }
28 |
29 | record LineItem(@Id int id, String sku , int customer) {
30 | }
31 |
32 | record Customer(@Id int id, String name, Set lineItems) {
33 | }
--------------------------------------------------------------------------------
/web/src/main/java/com/example/web/OrderRestController.java:
--------------------------------------------------------------------------------
1 | package com.example.web;
2 |
3 | import org.springframework.graphql.data.method.annotation.BatchMapping;
4 | import org.springframework.http.ResponseEntity;
5 | import org.springframework.stereotype.Controller;
6 | import org.springframework.web.bind.annotation.*;
7 |
8 | import java.util.Collection;
9 |
10 | @Controller
11 | @ResponseBody
12 | @RequestMapping("/orders")
13 | class OrderRestController {
14 |
15 |
16 | private final OrderService service;
17 |
18 | OrderRestController(OrderService service) {
19 | this.service = service;
20 | }
21 |
22 | // curl http://localhost:8080/orders
23 | @GetMapping
24 | Collection getAll() {
25 | return this.service.getAll();
26 | }
27 |
28 | // curl http://localhost:8080/orders/1
29 | @GetMapping("/{id}")
30 | Order getById(@PathVariable int id) {
31 | return this.service.getById(id);
32 | }
33 |
34 | // curl -XPOST -H"content-type: application/json" -d'{"sku":"12345" , "id":3, "price": 2322.0}' http://localhost:8080/orders
35 | @PostMapping
36 | ResponseEntity> create(@RequestBody Order order) {
37 | this.service.create(order);
38 | return ResponseEntity.ok().build();
39 | }
40 |
41 |
42 |
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/basics/src/main/java/com/example/basics/BasicsApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.basics;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.jdbc.core.simple.JdbcClient;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.web.bind.annotation.GetMapping;
8 | import org.springframework.web.bind.annotation.ResponseBody;
9 |
10 | import java.util.Collection;
11 |
12 | @SpringBootApplication
13 | public class BasicsApplication {
14 |
15 | public static void main(String[] args) {
16 | SpringApplication.run(BasicsApplication.class, args);
17 | }
18 |
19 | }
20 |
21 | @Controller
22 | @ResponseBody
23 | class CustomerController {
24 |
25 | private final JdbcClient db;
26 |
27 | CustomerController(JdbcClient db) {
28 | this.db = db;
29 | }
30 |
31 | @GetMapping ("/hello")
32 | String hello (){
33 | // refactor and rebuild
34 | return "Hello World!" ;
35 | }
36 |
37 | @GetMapping("/customers")
38 | Collection customers() {
39 | return this.db
40 | .sql("select * from customer")
41 | .query((rs, _) -> new Customer(rs.getInt("id"),
42 | rs.getString("name")))
43 | .list();
44 | }
45 | }
46 |
47 | record Customer(int id, String name) {
48 | }
49 |
--------------------------------------------------------------------------------
/integration/src/main/java/com/example/integration/IntegrationApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.integration;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.integration.core.GenericHandler;
8 | import org.springframework.integration.dsl.IntegrationFlow;
9 | import org.springframework.integration.file.dsl.Files;
10 |
11 | import java.io.File;
12 |
13 | @SpringBootApplication
14 | public class IntegrationApplication {
15 |
16 | public static void main(String[] args) {
17 | SpringApplication.run(IntegrationApplication.class, args);
18 | }
19 |
20 | @Bean
21 | IntegrationFlow newFilesIntegrationFlow(@Value("file://${HOME}/Desktop/inbound") File in,
22 | @Value("file://${HOME}/Desktop/outbound") File out) {
23 | return IntegrationFlow
24 | .from(Files.inboundAdapter(in).autoCreateDirectory(true))
25 | .handle((GenericHandler) (payload, _) -> {
26 | System.out.println("got a new file called " + payload.getAbsolutePath() + '.');
27 | return payload;
28 | })
29 | .handle(Files.outboundAdapter(out).autoCreateDirectory(true))
30 | .get();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/data-oriented-programming/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 3.3.4
9 |
10 |
11 | com.example
12 | data-oriented-programming
13 | 0.0.1-SNAPSHOT
14 | data-oriented-programming
15 | Demo project for Spring Boot
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 23
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter
36 |
37 |
38 |
39 | org.springframework.boot
40 | spring-boot-starter-test
41 | test
42 |
43 |
44 |
45 |
46 |
47 |
48 | org.springframework.boot
49 | spring-boot-maven-plugin
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/security/oauth-login/src/main/java/bootiful/oauth_login/OauthLoginApplication.java:
--------------------------------------------------------------------------------
1 | package bootiful.oauth_login;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.core.ParameterizedTypeReference;
6 | import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;
7 | import org.springframework.security.oauth2.client.annotation.RegisteredOAuth2AuthorizedClient;
8 | import org.springframework.stereotype.Controller;
9 | import org.springframework.web.bind.annotation.GetMapping;
10 | import org.springframework.web.bind.annotation.ResponseBody;
11 | import org.springframework.web.client.RestClient;
12 |
13 | import java.util.Map;
14 |
15 | @SpringBootApplication
16 | public class OauthLoginApplication {
17 |
18 | public static void main(String[] args) {
19 | SpringApplication.run(OauthLoginApplication.class, args);
20 | }
21 |
22 | }
23 |
24 | @Controller
25 | @ResponseBody
26 | class ClientController {
27 |
28 | private final RestClient http;
29 |
30 | ClientController(RestClient.Builder http) {
31 | this.http = http.build();
32 | }
33 |
34 | @GetMapping("/")
35 | Map hello(@RegisteredOAuth2AuthorizedClient OAuth2AuthorizedClient oAuth2AuthorizedClient) {
36 | var token = oAuth2AuthorizedClient.getAccessToken();
37 | return http
38 | .get()
39 | .uri("http://localhost:9091/")
40 | .headers(httpHeaders -> httpHeaders.setBearerAuth(token.getTokenValue()))
41 | .retrieve()
42 | .body(new ParameterizedTypeReference<>() {
43 | });
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/aot/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 3.3.4
9 |
10 |
11 | com.example
12 | aot
13 | 0.0.1-SNAPSHOT
14 | aot
15 | Demo project for Spring Boot
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 23
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-web
36 |
37 |
38 |
39 | org.springframework.boot
40 | spring-boot-starter-test
41 | test
42 |
43 |
44 |
45 |
46 |
47 |
48 | org.graalvm.buildtools
49 | native-maven-plugin
50 |
51 |
52 | org.springframework.boot
53 | spring-boot-maven-plugin
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/scalability/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 3.3.4
9 |
10 |
11 | com.example
12 | scalability
13 | 0.0.1-SNAPSHOT
14 | scalability
15 | Demo project for Spring Boot
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 23
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-web
36 |
37 |
38 |
39 | org.springframework.boot
40 | spring-boot-starter-test
41 | test
42 |
43 |
44 |
45 |
46 |
47 |
48 | org.graalvm.buildtools
49 | native-maven-plugin
50 |
51 |
52 | org.springframework.boot
53 | spring-boot-maven-plugin
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/beans/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 3.3.4
9 |
10 |
11 | com.example
12 | beans
13 | 0.0.1-SNAPSHOT
14 | beans
15 | Demo project for Spring Boot
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 23
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter
36 |
37 |
38 |
39 | org.springframework.boot
40 | spring-boot-starter-test
41 | test
42 |
43 |
44 | org.springframework.boot
45 | spring-boot-configuration-processor
46 | annotationProcessor
47 |
48 |
49 |
50 |
51 |
52 |
53 | org.springframework.boot
54 | spring-boot-maven-plugin
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/security/resource-server/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 3.3.3
9 |
10 |
11 | bootiful
12 | resource-server
13 | 0.0.1-SNAPSHOT
14 | resource-server
15 | Demo project for Spring Boot
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | 21
31 |
32 |
33 |
34 | org.springframework.boot
35 | spring-boot-starter-oauth2-resource-server
36 |
37 |
38 | org.springframework.boot
39 | spring-boot-starter-web
40 |
41 |
42 |
43 | org.springframework.boot
44 | spring-boot-starter-test
45 | test
46 |
47 |
48 |
49 |
50 |
51 |
52 | org.graalvm.buildtools
53 | native-maven-plugin
54 |
55 |
56 | org.springframework.boot
57 | spring-boot-maven-plugin
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/modularity/src/main/java/com/example/modularity/adoptions/DogAdoptionController.java:
--------------------------------------------------------------------------------
1 | package com.example.modularity.adoptions;
2 |
3 | import org.springframework.context.ApplicationEventPublisher;
4 | import org.springframework.data.annotation.Id;
5 | import org.springframework.data.repository.ListCrudRepository;
6 | import org.springframework.stereotype.Controller;
7 | import org.springframework.stereotype.Service;
8 | import org.springframework.transaction.annotation.Transactional;
9 | import org.springframework.web.bind.annotation.PathVariable;
10 | import org.springframework.web.bind.annotation.PostMapping;
11 |
12 | import java.util.Map;
13 |
14 | @Controller
15 | class DogAdoptionController {
16 |
17 | private final DogAdoptionService service;
18 |
19 | DogAdoptionController(DogAdoptionService service) {
20 | this.service = service;
21 | }
22 |
23 | @PostMapping("/dogs/{dogId}/adoptions")
24 | void adopt(@PathVariable int dogId, Map owner) {
25 | this.service.adopt(dogId, owner.get("name"));
26 | }
27 | }
28 |
29 |
30 | @Service
31 | @Transactional
32 | class DogAdoptionService {
33 |
34 | private final DogRepository repository;
35 | private final ApplicationEventPublisher publisher;
36 |
37 | DogAdoptionService(DogRepository repository, ApplicationEventPublisher publisher) {
38 | this.repository = repository;
39 | this.publisher = publisher;
40 | }
41 |
42 | void adopt(int dogId, String ownerName) {
43 | this.repository.findById(dogId).ifPresent(dog -> {
44 | var newDog = this.repository.save(new Dog(dog.id(),
45 | ownerName, dog.name()));
46 | System.out.println("adopted [" + newDog + "]");
47 | this.publisher.publishEvent(new DogAdoptionEvent(dog.id()));
48 | });
49 | }
50 | }
51 |
52 | interface DogRepository extends ListCrudRepository {
53 | }
54 |
55 | record Dog(@Id int id, String owner, String name) {
56 | }
--------------------------------------------------------------------------------
/microservices/service-a/src/main/java/com/example/service_a/ServiceAApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.service_a;
2 |
3 | import org.springframework.boot.ApplicationRunner;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.cloud.client.loadbalancer.LoadBalanced;
7 | import org.springframework.context.annotation.Bean;
8 | import org.springframework.core.ParameterizedTypeReference;
9 | import org.springframework.core.env.Environment;
10 | import org.springframework.stereotype.Controller;
11 | import org.springframework.web.bind.annotation.GetMapping;
12 | import org.springframework.web.bind.annotation.ResponseBody;
13 | import org.springframework.web.client.RestClient;
14 |
15 | import java.util.Map;
16 |
17 |
18 | @SpringBootApplication
19 | public class ServiceAApplication {
20 |
21 | public static void main(String[] args) {
22 | SpringApplication.run(ServiceAApplication.class, args);
23 | }
24 |
25 | @Bean
26 | ApplicationRunner configClientRunner(Environment environment) {
27 | return _ -> System.out.println("message: [" + environment.getProperty("message") + "]");
28 | }
29 |
30 | @Bean
31 | @LoadBalanced
32 | RestClient.Builder restClientBuilder() {
33 | return RestClient.builder();
34 | }
35 |
36 | @Bean
37 | RestClient restClient(RestClient.Builder builder) {
38 | return builder.build();
39 | }
40 | }
41 |
42 | @Controller
43 | @ResponseBody
44 | class ConsumerController {
45 |
46 | private final RestClient http;
47 |
48 | ConsumerController(RestClient http) {
49 | this.http = http;
50 | }
51 |
52 | @GetMapping("/call")
53 | Map call() {
54 | return this.http
55 | .get()
56 | .uri("http://service-b/answer")
57 | .retrieve()
58 | .body(new ParameterizedTypeReference