├── cdi
├── .mvn
│ ├── jvm.config
│ └── wrapper
│ │ └── maven-wrapper.properties
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── demo
│ │ │ │ ├── CreatePostCommand.java
│ │ │ │ ├── Post.java
│ │ │ │ ├── PostNotFoundException.java
│ │ │ │ ├── DemoApplication.java
│ │ │ │ ├── CdiAwareVerticleFactory.java
│ │ │ │ ├── Resources.java
│ │ │ │ ├── DataInitializer.java
│ │ │ │ ├── PostsHandler.java
│ │ │ │ ├── PostRepository.java
│ │ │ │ └── MainVerticle.java
│ │ └── resources
│ │ │ ├── logging.properties
│ │ │ └── META-INF
│ │ │ └── beans.xml
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ └── TestMainVerticle.java
├── .editorconfig
└── .gitignore
├── docs
├── starter.png
├── _config.yml
└── index.md
├── spring
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── demo
│ │ │ │ ├── CreatePostCommand.java
│ │ │ │ ├── Post.java
│ │ │ │ ├── PostNotFoundException.java
│ │ │ │ ├── SpringAwareVerticleFactory.java
│ │ │ │ ├── DemoApplication.java
│ │ │ │ ├── DataInitializer.java
│ │ │ │ ├── PostsHandler.java
│ │ │ │ ├── PostRepository.java
│ │ │ │ └── MainVerticle.java
│ │ └── resources
│ │ │ └── logging.properties
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ └── TestMainVerticle.java
└── .editorconfig
├── kotlin-co
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── src
│ ├── main
│ │ └── kotlin
│ │ │ └── com
│ │ │ └── example
│ │ │ └── demo
│ │ │ ├── PostNotFoundException.kt
│ │ │ ├── Models.kt
│ │ │ ├── DataInitializer.kt
│ │ │ ├── PostsHandler.kt
│ │ │ └── PostRepository.kt
│ └── test
│ │ └── kotlin
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ └── TestMainVerticle.kt
└── .editorconfig
├── renovate.json
├── mutiny-spring-hibernate
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── demo
│ │ │ │ ├── CreatePostCommand.java
│ │ │ │ ├── PostNotFoundException.java
│ │ │ │ ├── DemoApplication.java
│ │ │ │ ├── SpringAwareVerticleFactory.java
│ │ │ │ ├── Post.java
│ │ │ │ └── DataInitializer.java
│ │ └── resources
│ │ │ ├── logging.properties
│ │ │ └── META-INF
│ │ │ └── persistence.xml
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ └── TestMainVerticle.java
└── .editorconfig
├── rxjava3
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── demo
│ │ │ │ ├── CreatePostCommand.java
│ │ │ │ ├── Post.java
│ │ │ │ ├── PostNotFoundException.java
│ │ │ │ ├── DataInitializer.java
│ │ │ │ ├── PostsHandler.java
│ │ │ │ └── PostRepository.java
│ │ └── resources
│ │ │ └── logback.xml
│ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ └── TestMainVerticle.java
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── .editorconfig
├── README.adoc
└── .gitignore
├── graphql-http
├── src
│ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── demo
│ │ │ ├── gql
│ │ │ ├── types
│ │ │ │ ├── PostStatus.java
│ │ │ │ ├── CommentInput.java
│ │ │ │ ├── CreatePostInput.java
│ │ │ │ ├── Comment.java
│ │ │ │ ├── Author.java
│ │ │ │ └── Post.java
│ │ │ ├── scalars
│ │ │ │ ├── Scalars.java
│ │ │ │ ├── UUIDScalar.java
│ │ │ │ └── LocalDateTimeScalar.java
│ │ │ ├── directives
│ │ │ │ └── UpperCaseDirectiveWiring.java
│ │ │ ├── CustomDataFetchingExceptionHandler.java
│ │ │ └── DataLoaders.java
│ │ │ ├── model
│ │ │ ├── CommentEntity.java
│ │ │ ├── AuthorEntity.java
│ │ │ └── PostEntity.java
│ │ │ ├── repository
│ │ │ ├── PostNotFoundException.java
│ │ │ ├── AuthorNotFoundException.java
│ │ │ ├── CommentNotFoundException.java
│ │ │ ├── AuthorRepository.java
│ │ │ ├── CommentRepository.java
│ │ │ └── PostRepository.java
│ │ │ ├── service
│ │ │ ├── AuthorService.java
│ │ │ └── PostService.java
│ │ │ └── DataInitializer.java
│ │ └── resources
│ │ ├── schema
│ │ └── schema.graphql
│ │ └── logback.xml
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
└── .editorconfig
├── graphql-transport-ws
├── src
│ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── demo
│ │ │ ├── gql
│ │ │ ├── types
│ │ │ │ ├── PostStatus.java
│ │ │ │ ├── CommentInput.java
│ │ │ │ ├── CreatePostInput.java
│ │ │ │ ├── Comment.java
│ │ │ │ ├── Author.java
│ │ │ │ └── Post.java
│ │ │ ├── scalars
│ │ │ │ ├── Scalars.java
│ │ │ │ ├── UUIDScalar.java
│ │ │ │ └── LocalDateTimeScalar.java
│ │ │ ├── directives
│ │ │ │ └── UpperCaseDirectiveWiring.java
│ │ │ ├── CustomDataFetchingExceptionHandler.java
│ │ │ └── DataLoaders.java
│ │ │ ├── model
│ │ │ ├── AuthorEntity.java
│ │ │ ├── CommentEntity.java
│ │ │ └── PostEntity.java
│ │ │ ├── repository
│ │ │ ├── PostNotFoundException.java
│ │ │ ├── AuthorNotFoundException.java
│ │ │ ├── CommentNotFoundException.java
│ │ │ ├── AuthorRepository.java
│ │ │ ├── CommentRepository.java
│ │ │ └── PostRepository.java
│ │ │ ├── service
│ │ │ ├── AuthorService.java
│ │ │ └── PostService.java
│ │ │ └── DataInitializer.java
│ │ └── resources
│ │ ├── schema
│ │ └── schema.graphql
│ │ └── logback.xml
└── .mvn
│ └── wrapper
│ └── maven-wrapper.properties
├── kotlin
├── src
│ ├── main
│ │ └── kotlin
│ │ │ └── com
│ │ │ └── example
│ │ │ └── demo
│ │ │ ├── PostNotFoundException.kt
│ │ │ ├── Models.kt
│ │ │ ├── DataInitializer.kt
│ │ │ ├── PostRepository.kt
│ │ │ └── PostsHandler.kt
│ └── test
│ │ └── kotlin
│ │ └── com
│ │ └── example
│ │ └── demo
│ │ └── TestMainVerticle.kt
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── .editorconfig
└── .gitignore
├── web
├── .mvn
│ └── wrapper
│ │ └── maven-wrapper.properties
├── .editorconfig
├── src
│ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── demo
│ │ │ ├── PostNotFoundException.java
│ │ │ ├── CreatePostCommand.java
│ │ │ ├── Post.java
│ │ │ ├── DataInitializer.java
│ │ │ ├── PostsHandler.java
│ │ │ └── PostRepository.java
│ │ └── resources
│ │ └── vertx-default-jul-logging.properties
├── README.adoc
└── .gitignore
├── docker-compose.yml
├── .gitignore
├── .github
└── workflows
│ ├── cdi.yml
│ ├── web.yml
│ ├── spring.yml
│ ├── kolin.yml
│ ├── graphql-http.yml
│ ├── graphql-transport-ws.yml
│ ├── mutiny-spring-hibernate.yml
│ ├── rxjava3.yml
│ └── kotlin-co.yml
├── pg-initdb.d
└── init.sql
└── README.md
/cdi/.mvn/jvm.config:
--------------------------------------------------------------------------------
1 | --add-opens java.base/java.lang=ALL-UNNAMED
2 |
3 |
--------------------------------------------------------------------------------
/docs/starter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hantsy/vertx-sandbox/HEAD/docs/starter.png
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
2 | title: Eclipse Vertx Notes
3 | description: Developer notes of Eclipse Vertx 4.x
--------------------------------------------------------------------------------
/spring/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hantsy/vertx-sandbox/HEAD/spring/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/kotlin-co/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hantsy/vertx-sandbox/HEAD/kotlin-co/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": [
4 | "config:recommended"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/mutiny-spring-hibernate/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hantsy/vertx-sandbox/HEAD/mutiny-spring-hibernate/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/rxjava3/src/main/java/com/example/demo/CreatePostCommand.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | public record CreatePostCommand(String title, String content) {
4 | }
5 |
--------------------------------------------------------------------------------
/spring/src/main/java/com/example/demo/CreatePostCommand.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | public record CreatePostCommand(String title, String content) {
4 | }
5 |
--------------------------------------------------------------------------------
/mutiny-spring-hibernate/src/main/java/com/example/demo/CreatePostCommand.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | public record CreatePostCommand(String title, String content) {
4 | }
5 |
--------------------------------------------------------------------------------
/cdi/src/main/java/com/example/demo/CreatePostCommand.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.io.Serializable;
4 |
5 | public record CreatePostCommand(String title, String content) {}
6 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/gql/types/PostStatus.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | public enum PostStatus {
4 | DRAFT,
5 | PENDING_MODERATION,
6 | PUBLISHED
7 | }
8 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/gql/types/PostStatus.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | public enum PostStatus {
4 | DRAFT,
5 | PENDING_MODERATION,
6 | PUBLISHED
7 | }
8 |
--------------------------------------------------------------------------------
/kotlin-co/src/main/kotlin/com/example/demo/PostNotFoundException.kt:
--------------------------------------------------------------------------------
1 | package com.example.demo
2 |
3 | import java.util.*
4 |
5 | class PostNotFoundException(id: UUID) : RuntimeException("Post id: $id was not found. ")
6 |
--------------------------------------------------------------------------------
/kotlin/src/main/kotlin/com/example/demo/PostNotFoundException.kt:
--------------------------------------------------------------------------------
1 | package com.example.demo
2 |
3 | import java.util.*
4 |
5 | class PostNotFoundException(id: UUID) : RuntimeException("Post id: $id was not found. ")
6 |
--------------------------------------------------------------------------------
/kotlin-co/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
4 |
--------------------------------------------------------------------------------
/spring/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
4 |
--------------------------------------------------------------------------------
/cdi/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/4.0.0-rc-5/apache-maven-4.0.0-rc-5-bin.zip
4 |
--------------------------------------------------------------------------------
/kotlin/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/4.0.0-rc-5/apache-maven-4.0.0-rc-5-bin.zip
4 |
--------------------------------------------------------------------------------
/rxjava3/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/4.0.0-rc-5/apache-maven-4.0.0-rc-5-bin.zip
4 |
--------------------------------------------------------------------------------
/web/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/4.0.0-rc-5/apache-maven-4.0.0-rc-5-bin.zip
4 |
--------------------------------------------------------------------------------
/cdi/src/main/java/com/example/demo/Post.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record Post(UUID id, String title, String content, LocalDateTime createdAt) {}
7 |
--------------------------------------------------------------------------------
/graphql-http/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/4.0.0-rc-5/apache-maven-4.0.0-rc-5-bin.zip
4 |
--------------------------------------------------------------------------------
/mutiny-spring-hibernate/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
4 |
--------------------------------------------------------------------------------
/graphql-transport-ws/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | wrapperVersion=3.3.4
2 | distributionType=only-script
3 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/4.0.0-rc-5/apache-maven-4.0.0-rc-5-bin.zip
4 |
--------------------------------------------------------------------------------
/rxjava3/src/main/java/com/example/demo/Post.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record Post(UUID id, String title, String content, LocalDateTime createdAt) {
7 | }
8 |
--------------------------------------------------------------------------------
/cdi/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/web/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/kotlin/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/rxjava3/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/spring/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/graphql-http/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/kotlin-co/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/mutiny-spring-hibernate/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: https://EditorConfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 | end_of_line = lf
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/spring/src/main/java/com/example/demo/Post.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record Post(
7 | UUID id,
8 | String title,
9 | String content,
10 | LocalDateTime createdAt
11 | ) {}
12 |
--------------------------------------------------------------------------------
/cdi/src/main/java/com/example/demo/PostNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.util.UUID;
4 |
5 | public class PostNotFoundException extends RuntimeException {
6 | public PostNotFoundException(UUID id) {
7 | super("Post id: " + id + " was not found. ");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/web/src/main/java/com/example/demo/PostNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.util.UUID;
4 |
5 | public class PostNotFoundException extends RuntimeException {
6 | public PostNotFoundException(UUID id) {
7 | super("Post id: " + id + " was not found. ");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/rxjava3/src/main/java/com/example/demo/PostNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.util.UUID;
4 |
5 | public class PostNotFoundException extends RuntimeException {
6 | public PostNotFoundException(UUID id) {
7 | super("Post id: " + id + " was not found. ");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/spring/src/main/java/com/example/demo/PostNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.util.UUID;
4 |
5 | public class PostNotFoundException extends RuntimeException {
6 | public PostNotFoundException(UUID id) {
7 | super("Post id: " + id + " was not found. ");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/model/CommentEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.model;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record CommentEntity(
7 | UUID id,
8 | String content,
9 | LocalDateTime createdAt,
10 | UUID postId
11 | ) {
12 | }
13 |
--------------------------------------------------------------------------------
/mutiny-spring-hibernate/src/main/java/com/example/demo/PostNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.util.UUID;
4 |
5 | public class PostNotFoundException extends RuntimeException {
6 | public PostNotFoundException(UUID id) {
7 | super("Post id: " + id + " was not found. ");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/model/AuthorEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.model;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record AuthorEntity(
7 | UUID id,
8 | String name,
9 | String email,
10 | LocalDateTime createdAt
11 | ) {
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/repository/PostNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.repository;
2 |
3 | import java.util.UUID;
4 |
5 | public class PostNotFoundException extends RuntimeException {
6 | public PostNotFoundException(UUID id) {
7 | super("Post: " + id + " was not found.");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/model/AuthorEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.model;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record AuthorEntity(
7 | UUID id,
8 | String name,
9 | String email,
10 | LocalDateTime createdAt
11 | ) {
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/model/CommentEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.model;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record CommentEntity(
7 | UUID id,
8 | String content,
9 | LocalDateTime createdAt,
10 | UUID postId
11 | ) {
12 | }
13 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/repository/AuthorNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.repository;
2 |
3 | import java.util.UUID;
4 |
5 | public class AuthorNotFoundException extends RuntimeException {
6 | public AuthorNotFoundException(UUID id) {
7 | super("Author: " + id + " was not found.");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/repository/PostNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.repository;
2 |
3 | import java.util.UUID;
4 |
5 | public class PostNotFoundException extends RuntimeException {
6 | public PostNotFoundException(UUID id) {
7 | super("Post: " + id + " was not found.");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/repository/CommentNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.repository;
2 |
3 | import java.util.UUID;
4 |
5 | public class CommentNotFoundException extends RuntimeException {
6 | public CommentNotFoundException(UUID id) {
7 | super("Comment: " + id + " was not found.");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/repository/AuthorNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.repository;
2 |
3 | import java.util.UUID;
4 |
5 | public class AuthorNotFoundException extends RuntimeException {
6 | public AuthorNotFoundException(UUID id) {
7 | super("Author: " + id + " was not found.");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/repository/CommentNotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.repository;
2 |
3 | import java.util.UUID;
4 |
5 | public class CommentNotFoundException extends RuntimeException {
6 | public CommentNotFoundException(UUID id) {
7 | super("Comment: " + id + " was not found.");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/cdi/src/main/resources/logging.properties:
--------------------------------------------------------------------------------
1 |
2 | java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n
3 |
4 | # Global logging level. Can be overridden by specific loggers
5 | .level=INFO
6 |
7 | # Component specific log levels
8 | #io.netty.level=INFO
9 | #io.vertx.core.level=FINEST
10 | #com.example.demo.level=FINEST
11 |
--------------------------------------------------------------------------------
/spring/src/main/resources/logging.properties:
--------------------------------------------------------------------------------
1 |
2 | java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n
3 |
4 | # Global logging level. Can be overridden by specific loggers
5 | .level=INFO
6 |
7 | # Component specific log levels
8 | #io.netty.level=INFO
9 | #io.vertx.core.level=FINEST
10 | #com.example.demo.level=FINEST
11 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/model/PostEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.model;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record PostEntity(
7 | UUID id,
8 | String title,
9 | String content,
10 | String status,
11 | LocalDateTime createdAt,
12 | UUID authorId
13 | ) {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/web/src/main/resources/vertx-default-jul-logging.properties:
--------------------------------------------------------------------------------
1 |
2 | java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n
3 |
4 | # Global logging level. Can be overridden by specific loggers
5 | .level=INFO
6 |
7 | # Component specific log levels
8 | io.netty.level=INFO
9 | io.vertx.core.level=FINEST
10 | com.example.demo.level=FINEST
11 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/model/PostEntity.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.model;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 |
6 | public record PostEntity(
7 | UUID id,
8 | String title,
9 | String content,
10 | String status,
11 | LocalDateTime createdAt,
12 | UUID authorId
13 | ) {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/mutiny-spring-hibernate/src/main/resources/logging.properties:
--------------------------------------------------------------------------------
1 |
2 | java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n
3 |
4 | # Global logging level. Can be overridden by specific loggers
5 | .level=INFO
6 |
7 | # Component specific log levels
8 | #io.netty.level=INFO
9 | #io.vertx.core.level=FINEST
10 | #com.example.demo.level=FINEST
11 |
--------------------------------------------------------------------------------
/cdi/src/main/resources/META-INF/beans.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/gql/types/CommentInput.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | @Data
9 | @Builder
10 | @NoArgsConstructor
11 | @AllArgsConstructor
12 | public class CommentInput {
13 | private String postId;
14 | private String content;
15 | }
16 |
--------------------------------------------------------------------------------
/kotlin/src/main/kotlin/com/example/demo/Models.kt:
--------------------------------------------------------------------------------
1 | package com.example.demo
2 |
3 | import java.time.LocalDateTime
4 | import java.util.*
5 |
6 | data class Post(
7 | var id: UUID? = null,
8 | var title: String,
9 | var content: String,
10 | var createdAt: LocalDateTime? = LocalDateTime.now()
11 | )
12 |
13 | data class CreatePostCommand(
14 | val title: String,
15 | val content: String
16 | )
17 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | # version: '3.7' # specify docker-compose version
2 |
3 | services:
4 | postgres:
5 | image: postgres
6 | ports:
7 | - "5432:5432"
8 | restart: always
9 | environment:
10 | POSTGRES_PASSWORD: password
11 | POSTGRES_DB: blogdb
12 | POSTGRES_USER: user
13 | volumes:
14 | - ./data:/var/lib/postgresql
15 | - ./pg-initdb.d:/docker-entrypoint-initdb.d
16 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/gql/types/CommentInput.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | @Data
9 | @Builder
10 | @NoArgsConstructor
11 | @AllArgsConstructor
12 | public class CommentInput {
13 | private String postId;
14 | private String content;
15 | }
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23 | hs_err_pid*
24 | .idea
25 | *.iml
26 |
27 | .project
28 | .classpath
29 | .vscode
30 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/gql/types/CreatePostInput.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.util.Objects;
10 |
11 | @Data
12 | @Builder
13 | @NoArgsConstructor
14 | @AllArgsConstructor
15 | public class CreatePostInput {
16 |
17 | String title;
18 | String content;
19 | }
20 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/gql/types/CreatePostInput.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.io.Serializable;
9 | import java.util.Objects;
10 |
11 | @Data
12 | @Builder
13 | @NoArgsConstructor
14 | @AllArgsConstructor
15 | public class CreatePostInput {
16 |
17 | String title;
18 | String content;
19 | }
20 |
--------------------------------------------------------------------------------
/kotlin-co/src/main/kotlin/com/example/demo/Models.kt:
--------------------------------------------------------------------------------
1 | package com.example.demo
2 |
3 | import java.time.LocalDateTime
4 | import java.util.*
5 |
6 | data class Post(
7 | var id: UUID? = null,
8 | var title: String,
9 | var content: String,
10 | var createdAt: LocalDateTime? = LocalDateTime.now()
11 | )
12 |
13 | data class CreatePostCommand(
14 | val title: String,
15 | val content: String
16 | )
17 |
18 | data class UpdatePostCommand(
19 | val title: String,
20 | val content: String
21 | )
22 |
--------------------------------------------------------------------------------
/web/src/main/java/com/example/demo/CreatePostCommand.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.util.Objects;
4 |
5 | public record CreatePostCommand(String title, String content) {
6 | public CreatePostCommand {
7 | Objects.requireNonNull(title, "title must not be null");
8 | Objects.requireNonNull(content, "content must not be null");
9 | }
10 |
11 | public static CreatePostCommand of(String title, String content) {
12 | return new CreatePostCommand(title, content);
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/gql/types/Comment.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.time.LocalDateTime;
9 |
10 | @Data
11 | @Builder
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | public class Comment {
15 |
16 | private String id;
17 |
18 | private String content;
19 |
20 | private LocalDateTime createdAt;
21 |
22 | private String postId;
23 | }
24 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/gql/types/Comment.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.time.LocalDateTime;
9 |
10 | @Data
11 | @Builder
12 | @NoArgsConstructor
13 | @AllArgsConstructor
14 | public class Comment {
15 |
16 | private String id;
17 |
18 | private String content;
19 |
20 | private LocalDateTime createdAt;
21 |
22 | private String postId;
23 | }
24 |
--------------------------------------------------------------------------------
/web/src/main/java/com/example/demo/Post.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import java.time.LocalDateTime;
4 | import java.util.UUID;
5 | import java.util.Objects;
6 |
7 | public record Post(UUID id, String title, String content, LocalDateTime createdAt) {
8 |
9 | public Post {
10 | Objects.requireNonNull(title, "title must not be null");
11 | Objects.requireNonNull(content, "content must not be null");
12 | }
13 |
14 | public static Post of(String title, String content) {
15 | return new Post(null, title, content, null);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/gql/types/Author.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.time.LocalDateTime;
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | @Data
13 | @Builder
14 | @NoArgsConstructor
15 | @AllArgsConstructor
16 | public class Author {
17 |
18 | private String id;
19 |
20 | private String name;
21 |
22 | private String email;
23 |
24 | private LocalDateTime createdAt;
25 |
26 | @Builder.Default
27 | private List posts = new ArrayList<>();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/gql/types/Author.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.time.LocalDateTime;
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | @Data
13 | @Builder
14 | @NoArgsConstructor
15 | @AllArgsConstructor
16 | public class Author {
17 |
18 | private String id;
19 |
20 | private String name;
21 |
22 | private String email;
23 |
24 | private LocalDateTime createdAt;
25 |
26 | @Builder.Default
27 | private List posts = new ArrayList<>();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/gql/types/Post.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.time.LocalDateTime;
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | @Data
13 | @Builder
14 | @NoArgsConstructor
15 | @AllArgsConstructor
16 | public class Post {
17 | private String id;
18 | private String title;
19 | private String content;
20 |
21 | @Builder.Default
22 | private List comments = new ArrayList<>();
23 | private PostStatus status;
24 | private LocalDateTime createdAt;
25 |
26 | private String authorId;
27 | private Author author;
28 | }
29 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/gql/types/Post.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.types;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Builder;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 | import java.time.LocalDateTime;
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | @Data
13 | @Builder
14 | @NoArgsConstructor
15 | @AllArgsConstructor
16 | public class Post {
17 | private String id;
18 | private String title;
19 | private String content;
20 |
21 | @Builder.Default
22 | private List comments = new ArrayList<>();
23 | private PostStatus status;
24 | private LocalDateTime createdAt;
25 |
26 | private String authorId;
27 | private Author author;
28 | }
29 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/gql/scalars/Scalars.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.scalars;
2 |
3 | import graphql.schema.GraphQLScalarType;
4 |
5 | public class Scalars {
6 |
7 | public static GraphQLScalarType uuidType() {
8 | return GraphQLScalarType.newScalar()
9 | .name("UUID")
10 | .description("UUID type")
11 | .coercing(new UUIDScalar())
12 | .build();
13 | }
14 |
15 | public static GraphQLScalarType localDateTimeType() {
16 | return GraphQLScalarType.newScalar()
17 | .name("LocalDateTime")
18 | .description("LocalDateTime type")
19 | .coercing(new LocalDateTimeScalar())
20 | .build();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/web/README.adoc:
--------------------------------------------------------------------------------
1 | = Demo
2 |
3 | image:https://img.shields.io/badge/vert.x-4.0.0-purple.svg[link="https://vertx.io"]
4 |
5 | This application was generated using http://start.vertx.io
6 |
7 | == Building
8 |
9 | To launch your tests:
10 | ```
11 | ./mvnw clean test
12 | ```
13 |
14 | To package your application:
15 | ```
16 | ./mvnw clean package
17 | ```
18 |
19 | To run your application:
20 | ```
21 | ./mvnw clean compile exec:java
22 | ```
23 |
24 | == Help
25 |
26 | * https://vertx.io/docs/[Vert.x Documentation]
27 | * https://stackoverflow.com/questions/tagged/vert.x?sort=newest&pageSize=15[Vert.x Stack Overflow]
28 | * https://groups.google.com/forum/?fromgroups#!forum/vertx[Vert.x User Group]
29 | * https://gitter.im/eclipse-vertx/vertx-users[Vert.x Gitter]
30 |
31 |
32 |
--------------------------------------------------------------------------------
/rxjava3/README.adoc:
--------------------------------------------------------------------------------
1 | = Demo
2 |
3 | image:https://img.shields.io/badge/vert.x-4.0.0-purple.svg[link="https://vertx.io"]
4 |
5 | This application was generated using http://start.vertx.io
6 |
7 | == Building
8 |
9 | To launch your tests:
10 | ```
11 | ./mvnw clean test
12 | ```
13 |
14 | To package your application:
15 | ```
16 | ./mvnw clean package
17 | ```
18 |
19 | To run your application:
20 | ```
21 | ./mvnw clean compile exec:java
22 | ```
23 |
24 | == Help
25 |
26 | * https://vertx.io/docs/[Vert.x Documentation]
27 | * https://stackoverflow.com/questions/tagged/vert.x?sort=newest&pageSize=15[Vert.x Stack Overflow]
28 | * https://groups.google.com/forum/?fromgroups#!forum/vertx[Vert.x User Group]
29 | * https://gitter.im/eclipse-vertx/vertx-users[Vert.x Gitter]
30 |
31 |
32 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/gql/scalars/Scalars.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.scalars;
2 |
3 | import graphql.schema.GraphQLScalarType;
4 |
5 | public class Scalars {
6 |
7 | public static GraphQLScalarType uuidType() {
8 | return GraphQLScalarType.newScalar()
9 | .name("UUID")
10 | .description("UUID type")
11 | .coercing(new UUIDScalar())
12 | .build();
13 | }
14 |
15 | public static GraphQLScalarType localDateTimeType() {
16 | return GraphQLScalarType.newScalar()
17 | .name("LocalDateTime")
18 | .description("LocalDateTime type")
19 | .coercing(new LocalDateTimeScalar())
20 | .build();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 | * [Building RESTful APIs with Eclipse Vertx](./rest.md)
5 | * [Building RESTful APIs with Eclipse Vertx and RxJava 3](./rxjava3.md)
6 | * [Exception Handling and Validation Handlers](./validation.md)
7 | * [Consuming RESTful APIs with Vertx HttpClient](./client.md)
8 | * [Building RESTful APIs with Eclipse Vertx and Kotlin](./kotlin.md)
9 | * [Building RESTful APIs with Eclipse Vertx and Kotlin Coroutines](./kotlin-co.md)
10 | * [Building RESTful APIs with Eclipse Vertx, SmallRye Mutiny, Spring and Hibernate](./hibernate.md)
11 | * [Integrate Vertx Application with Spring](./spring.md)
12 | * [Integrate Vertx Application with CDI](./cdi.md)
13 | * [Building GraphQL APIs with Eclipse Vertx](./graphql.md)
14 | * [Consuming GraphQL APIs with Vertx WebClient](./graphql-client.md)
15 |
16 |
--------------------------------------------------------------------------------
/.github/workflows/cdi.yml:
--------------------------------------------------------------------------------
1 | name: cdi
2 |
3 | on:
4 | push:
5 | paths:
6 | - "cdi/**"
7 | branches:
8 | - master
9 | pull_request:
10 | paths:
11 | - "cdi/**"
12 | types:
13 | - opened
14 | - synchronize
15 | - reopened
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v6
22 | - name: Set up Java
23 | uses: actions/setup-java@v5
24 | with:
25 | distribution: 'zulu'
26 | java-version: '21'
27 | cache: 'maven'
28 |
29 | - name: Start up databases via Docker Compose
30 | run: |
31 | docker compose up -d postgres
32 | docker ps -a
33 | - name: Build cdi
34 | run: mvn clean install --file cdi/pom.xml
35 |
--------------------------------------------------------------------------------
/.github/workflows/web.yml:
--------------------------------------------------------------------------------
1 | name: web
2 |
3 | on:
4 | push:
5 | paths:
6 | - "web/**"
7 | branches:
8 | - master
9 | pull_request:
10 | paths:
11 | - "web/**"
12 | types:
13 | - opened
14 | - synchronize
15 | - reopened
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v6
22 | - name: Set up Java
23 | uses: actions/setup-java@v5
24 | with:
25 | distribution: 'zulu'
26 | java-version: '21'
27 | cache: 'maven'
28 |
29 | - name: Start up databases via Docker Compose
30 | run: |
31 | docker compose up -d postgres
32 | docker ps -a
33 |
34 | - name: Build web
35 | run: mvn clean install --file web/pom.xml
36 |
37 |
38 |
--------------------------------------------------------------------------------
/.github/workflows/spring.yml:
--------------------------------------------------------------------------------
1 | name: spring
2 |
3 | on:
4 | push:
5 | paths:
6 | - "spring/**"
7 | branches:
8 | - master
9 | pull_request:
10 | paths:
11 | - "spring/**"
12 | types:
13 | - opened
14 | - synchronize
15 | - reopened
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v6
22 | - name: Set up Java
23 | uses: actions/setup-java@v5
24 | with:
25 | distribution: 'zulu'
26 | java-version: '21'
27 | cache: 'maven'
28 |
29 | - name: Start up databases via Docker Compose
30 | run: |
31 | docker compose up -d postgres
32 | docker ps -a
33 | - name: Build spring
34 | run: mvn clean install --file spring/pom.xml
35 |
--------------------------------------------------------------------------------
/.github/workflows/kolin.yml:
--------------------------------------------------------------------------------
1 | name: kotlin
2 |
3 | on:
4 | push:
5 | paths:
6 | - "kotlin/**"
7 | branches:
8 | - master
9 | pull_request:
10 | paths:
11 | - "kotlin/**"
12 | types:
13 | - opened
14 | - synchronize
15 | - reopened
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v6
22 | - name: Set up Java
23 | uses: actions/setup-java@v5
24 | with:
25 | distribution: 'zulu'
26 | java-version: '21'
27 | cache: 'maven'
28 |
29 | - name: Start up databases via Docker Compose
30 | run: |
31 | docker compose up -d postgres
32 | docker ps -a
33 | - name: Build kotlin
34 | run: mvn clean install --file kotlin/pom.xml
35 |
--------------------------------------------------------------------------------
/.github/workflows/graphql-http.yml:
--------------------------------------------------------------------------------
1 | name: graphql-http
2 |
3 | on:
4 | push:
5 | paths:
6 | - "graphql-http/**"
7 | branches:
8 | - master
9 | pull_request:
10 | paths:
11 | - "graphql-http/**"
12 | types:
13 | - opened
14 | - synchronize
15 | - reopened
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v6
22 | - name: Set up Java
23 | uses: actions/setup-java@v5
24 | with:
25 | distribution: 'zulu'
26 | java-version: '21'
27 | cache: 'maven'
28 |
29 | - name: Start up databases via Docker Compose
30 | run: |
31 | docker compose up -d postgres
32 | docker ps -a
33 | - name: Build graphql-http
34 | run: mvn clean install --file graphql-http/pom.xml
--------------------------------------------------------------------------------
/.github/workflows/graphql-transport-ws.yml:
--------------------------------------------------------------------------------
1 | name: graphql-transport-ws
2 |
3 | on:
4 | push:
5 | paths:
6 | - "graphql-transport-ws/**"
7 | branches:
8 | - master
9 | pull_request:
10 | paths:
11 | - "graphql-transport-ws/**"
12 | types:
13 | - opened
14 | - synchronize
15 | - reopened
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v6
22 | - name: Set up Java
23 | uses: actions/setup-java@v5
24 | with:
25 | distribution: 'zulu'
26 | java-version: '21'
27 | cache: 'maven'
28 |
29 | - name: Start up databases via Docker Compose
30 | run: |
31 | docker compose up -d postgres
32 | docker ps -a
33 | - name: Build graphql
34 | run: mvn clean install --file graphql-transport-ws/pom.xml
35 |
--------------------------------------------------------------------------------
/.github/workflows/mutiny-spring-hibernate.yml:
--------------------------------------------------------------------------------
1 | name: mutiny-spring-hibernate
2 |
3 | on:
4 | push:
5 | paths:
6 | - "mutiny-spring-hibernate/**"
7 | branches:
8 | - master
9 | pull_request:
10 | paths:
11 | - "mutiny-spring-hibernate/**"
12 | types:
13 | - opened
14 | - synchronize
15 | - reopened
16 | jobs:
17 |
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v6
22 | - name: Set up Java
23 | uses: actions/setup-java@v5
24 | with:
25 | distribution: 'zulu'
26 | java-version: '21'
27 | cache: 'maven'
28 |
29 | - name: Start up databases via Docker Compose
30 | run: |
31 | docker compose up -d postgres
32 | docker ps -a
33 | - name: Build with Maven
34 | run: mvn clean install --file mutiny-spring-hibernate/pom.xml
35 |
36 |
--------------------------------------------------------------------------------
/graphql-http/src/main/java/com/example/demo/gql/directives/UpperCaseDirectiveWiring.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.directives;
2 |
3 | import graphql.schema.*;
4 | import graphql.schema.idl.SchemaDirectiveWiring;
5 | import graphql.schema.idl.SchemaDirectiveWiringEnvironment;
6 |
7 | public class UpperCaseDirectiveWiring implements SchemaDirectiveWiring {
8 | @Override
9 | public GraphQLFieldDefinition onField(SchemaDirectiveWiringEnvironment env) {
10 |
11 | var field = env.getElement();
12 | var dataFetcher = DataFetcherFactories.wrapDataFetcher(env.getFieldDataFetcher(),
13 | (dataFetchingEnvironment, value) -> {
14 | if (value instanceof String s) {
15 | return s.toUpperCase();
16 | }
17 | return value;
18 | }
19 | );
20 |
21 | env.setFieldDataFetcher(dataFetcher);
22 | return field;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/graphql-transport-ws/src/main/java/com/example/demo/gql/directives/UpperCaseDirectiveWiring.java:
--------------------------------------------------------------------------------
1 | package com.example.demo.gql.directives;
2 |
3 | import graphql.schema.*;
4 | import graphql.schema.idl.SchemaDirectiveWiring;
5 | import graphql.schema.idl.SchemaDirectiveWiringEnvironment;
6 |
7 | public class UpperCaseDirectiveWiring implements SchemaDirectiveWiring {
8 | @Override
9 | public GraphQLFieldDefinition onField(SchemaDirectiveWiringEnvironment env) {
10 |
11 | var field = env.getElement();
12 | var dataFetcher = DataFetcherFactories.wrapDataFetcher(env.getFieldDataFetcher(),
13 | (dataFetchingEnvironment, value) -> {
14 | if (value instanceof String s) {
15 | return s.toUpperCase();
16 | }
17 | return value;
18 | }
19 | );
20 |
21 | env.setFieldDataFetcher(dataFetcher);
22 | return field;
23 | }
24 | }
--------------------------------------------------------------------------------
/pg-initdb.d/init.sql:
--------------------------------------------------------------------------------
1 | CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
2 |
3 | CREATE TABLE IF NOT EXISTS users (
4 | id UUID DEFAULT uuid_generate_v4(),
5 | name VARCHAR(255) NOT NULL,
6 | email VARCHAR(255) NOT NULL,
7 | password VARCHAR(255) NOT NULL DEFAULT 'password',
8 | created_at TIMESTAMP,
9 | version INTEGER,
10 | PRIMARY KEY (id)
11 | );
12 |
13 | CREATE TABLE IF NOT EXISTS posts (
14 | id UUID DEFAULT uuid_generate_v4(),
15 | title VARCHAR(255),
16 | content VARCHAR(255),
17 | status VARCHAR(255) DEFAULT 'DRAFT',
18 | author_id UUID REFERENCES users,
19 | created_at TIMESTAMP NOT NULL DEFAULT LOCALTIMESTAMP,
20 | updated_at TIMESTAMP,
21 | version INTEGER,
22 | PRIMARY KEY (id)
23 | );
24 |
25 | CREATE TABLE IF NOT EXISTS comments (
26 | id UUID DEFAULT uuid_generate_v4(),
27 | content VARCHAR(255),
28 | post_id UUID REFERENCES posts ON DELETE CASCADE,
29 | created_at TIMESTAMP NOT NULL DEFAULT LOCALTIMESTAMP,
30 | version INTEGER,
31 | PRIMARY KEY (id)
32 | );
33 |
--------------------------------------------------------------------------------
/cdi/src/main/java/com/example/demo/DemoApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import io.vertx.core.Vertx;
4 | import io.vertx.core.spi.VerticleFactory;
5 | import org.jboss.weld.environment.se.Weld;
6 |
7 | import java.util.logging.Logger;
8 |
9 | public class DemoApplication {
10 |
11 | private static final Logger LOGGER = Logger.getLogger(DemoApplication.class.getName());
12 |
13 | public static void main(String[] args) {
14 | var weld = new Weld();
15 | var container = weld.initialize();
16 | Vertx vertx = container.select(Vertx.class).get();
17 | VerticleFactory factory = container.select(VerticleFactory.class).get();
18 |
19 | LOGGER.info("vertx clazz:" + vertx.getClass().getName());//Weld does not create proxy classes at runtime on @Singleton beans.
20 | LOGGER.info("factory clazz:" + factory.getClass().getName());
21 | // deploy MainVerticle via verticle identifier name
22 | vertx.deployVerticle(factory.prefix() + ":" + MainVerticle.class.getName());
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/.github/workflows/rxjava3.yml:
--------------------------------------------------------------------------------
1 | name: rxjava3
2 |
3 | on:
4 | push:
5 | paths:
6 | - "rxjava3/**"
7 | branches:
8 | - master
9 | pull_request:
10 | paths:
11 | - "rxjava3/**"
12 | types:
13 | - opened
14 | - synchronize
15 | - reopened
16 |
17 | jobs:
18 | build:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v6
22 | - name: Set up Java
23 | uses: actions/setup-java@v5
24 | with:
25 | distribution: 'zulu'
26 | java-version: '21'
27 | cache: 'maven'
28 |
29 | - name: Start up databases via Docker Compose
30 | run: |
31 | docker compose up -d postgres
32 | docker ps -a
33 |
34 | - name: Test with CURL
35 | run: |
36 | mvn clean package exec:java -DskipTests --file rxjava3/pom.xml &
37 | sleep 10
38 | echo ">>> print cURL result <<<"
39 | curl http://localhost:8888/hello &
40 |
41 | - name: Build rxjava3
42 | run: mvn clean install --file rxjava3/pom.xml
43 |
--------------------------------------------------------------------------------
/cdi/src/main/java/com/example/demo/CdiAwareVerticleFactory.java:
--------------------------------------------------------------------------------
1 | package com.example.demo;
2 |
3 | import io.vertx.core.Deployable;
4 | import io.vertx.core.Promise;
5 | import io.vertx.core.Verticle;
6 | import io.vertx.core.VerticleBase;
7 | import io.vertx.core.spi.VerticleFactory;
8 |
9 | import jakarta.enterprise.context.ApplicationScoped;
10 | import jakarta.enterprise.inject.Instance;
11 | import jakarta.inject.Inject;
12 | import java.util.concurrent.Callable;
13 |
14 | // see: https://github.com/vert-x3/vertx-examples/blob/4.x/spring-examples/spring-verticle-factory/src/main/java/io/vertx/examples/spring/verticlefactory/SpringVerticleFactory.java
15 | @ApplicationScoped
16 | public class CdiAwareVerticleFactory implements VerticleFactory {
17 |
18 | @Inject
19 | private Instance