Skip to content

Commit

Permalink
chore: bump Quarkus to 3.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hantsy committed May 1, 2024
1 parent 427a2ee commit 9005fcd
Show file tree
Hide file tree
Showing 45 changed files with 146 additions and 249 deletions.
2 changes: 1 addition & 1 deletion amqp-rabbitmq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>

<!-- dependencies -->
<quarkus.version>3.10.0.CR1</quarkus.version>
<quarkus.version>3.10.0</quarkus.version>
<lombok.version>1.18.32</lombok.version>
<assertj.version>3.25.3</assertj.version>
<awaitility.version>4.2.1</awaitility.version>
Expand Down
2 changes: 1 addition & 1 deletion amqp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>

<!-- dependencies -->
<quarkus.version>3.10.0.CR1</quarkus.version>
<quarkus.version>3.10.0</quarkus.version>
<lombok.version>1.18.32</lombok.version>
<assertj.version>3.25.3</assertj.version>
<awaitility.version>4.2.1</awaitility.version>
Expand Down
10 changes: 1 addition & 9 deletions graphql-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<maven.compiler.parameters>true</maven.compiler.parameters>

<!-- dependencies -->
<quarkus.version>3.10.0.CR1</quarkus.version>
<quarkus.version>3.10.0</quarkus.version>
<lombok.version>1.18.32</lombok.version>
</properties>
<dependencyManagement>
Expand Down Expand Up @@ -48,14 +48,6 @@
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jsonp</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
Expand Down
19 changes: 4 additions & 15 deletions graphql-client/src/main/java/com/example/demo/Comment.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
package com.example.demo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.microprofile.graphql.Id;
import org.eclipse.microprofile.graphql.Type;
public record Comment(
String id,
String content
) {

@Data
@Builder
@Type
@NoArgsConstructor
@AllArgsConstructor
public class Comment {
@Id
String id;
String content;
}
23 changes: 3 additions & 20 deletions graphql-client/src/main/java/com/example/demo/CreatePost.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
package com.example.demo;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.microprofile.graphql.Input;
import org.hibernate.validator.constraints.Length;
public record CreatePost(
String title,
String content) {

import jakarta.validation.constraints.NotEmpty;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Input
public class CreatePost {

@NotEmpty// bean validation dose not work.
@Length(min = 5)
String title;

String content;
}
25 changes: 12 additions & 13 deletions graphql-client/src/main/java/com/example/demo/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

import io.quarkus.runtime.QuarkusApplication;
import io.quarkus.runtime.annotations.QuarkusMain;

import jakarta.inject.Inject;
import lombok.extern.slf4j.Slf4j;

import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;

@Slf4j
@QuarkusMain
public class Main implements QuarkusApplication {
public static final Logger LOGGER = Logger.getLogger(Main.class.getName());

@Inject
PostGraphQLClient clientApi;
Expand Down Expand Up @@ -40,40 +39,40 @@ public int run(String... args) throws Exception {
// return a `ErrorOr` instead.
var post = this.clientApi.getPostById(id);
if (post.isPresent()) {
LOGGER.log(Level.INFO, "found: {0}", post.get());
log.debug("found: {}", post.get());
}
if (post.hasErrors()) {
post.getErrors().forEach(
error -> LOGGER.log(Level.INFO, "error: path={0}, message={1}", new Object[]{error.getPath(), error.getMessage()})
error -> log.error("error: path={}, message={}", error.getPath(), error.getMessage())
);
}


this.clientApi.getAllPosts().forEach(
p -> LOGGER.log(Level.INFO, "post: {0}", p)
p -> log.debug("posts from clientApi: {}", p)
);

this.clientApi.getAllPostSummaries().forEach(
p -> LOGGER.log(Level.INFO, "post summary: {0}", p)
p -> log.debug("post summary from clientApi: {}", p)
);

this.dynamicClient.getAllPosts().forEach(
p -> LOGGER.log(Level.INFO, "post from dynamic client: {0}", p)
p -> log.debug("post from dynamicClient: {}", p)
);

this.jvmClient.getAllPosts()
.thenAccept(
p -> LOGGER.log(Level.INFO, "post from jvm client: {0}", p)
p -> log.debug("post from jvmClient: {}", p)
)
.whenComplete((d, e) -> LOGGER.info("The request is done in the jvm client."))
.whenComplete((d, e) -> log.debug("The request is done in the jvm client."))
.toCompletableFuture()
.join();

this.jaxrsClient.getAllPosts()
.thenAccept(
p -> LOGGER.log(Level.INFO, "post from Jaxrs client: {0}", p)
p -> log.debug("post from JaxrsClient: {}", p)
)
.whenComplete((d, e) -> LOGGER.info("The request is done in the Jaxrs client."))
.whenComplete((d, e) -> log.debug("The request is done in the Jaxrs client."))
.toCompletableFuture()
.join();

Expand Down
27 changes: 7 additions & 20 deletions graphql-client/src/main/java/com/example/demo/Post.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
package com.example.demo;

import lombok.*;
import org.eclipse.microprofile.graphql.Id;
import org.eclipse.microprofile.graphql.Type;

import java.util.ArrayList;
import java.util.List;

@Data
@Builder
@ToString
@Type
@NoArgsConstructor
@AllArgsConstructor
public class Post {
@Id
String id;
String title;
String content;

int countOfComments;
public record Post(
String id,
String title,
String content,
int countOfComments,
List<Comment> comments
) {

@Builder.Default
List<Comment> comments = new ArrayList<>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import io.smallrye.graphql.client.Response;
import io.smallrye.graphql.client.core.Document;
import io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

import java.util.List;
import java.util.concurrent.ExecutionException;

Expand All @@ -18,7 +18,7 @@
public class PostDynamicClient {

@Inject
@GraphQLClient("post-dynamic-client")
@GraphQLClient("post-client-dynamic")
DynamicGraphQLClient dynamicClient;

public List<Post> getAllPosts() throws ExecutionException, InterruptedException {
Expand All @@ -28,6 +28,7 @@ public List<Post> getAllPosts() throws ExecutionException, InterruptedException
field("id"),
field("title"),
field("content"),
field("countOfComments"),
field("comments",
field("id"),
field("content")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
import io.smallrye.graphql.client.typesafe.api.GraphQLClientApi;
import org.eclipse.microprofile.graphql.*;

import jakarta.validation.Valid;
import java.util.List;

@GraphQLClientApi
@GraphQLClientApi(configKey = "post-client-typesafe")
public interface PostGraphQLClient {
@Query()
public List<Post> getAllPosts() ;
public List<Post> getAllPosts();

@Query("allPosts")
public List<PostSummary> getAllPostSummaries() ;
public List<PostSummary> getAllPostSummaries();

public int countOfComments(@Source Post post);

Expand All @@ -23,5 +22,5 @@ public interface PostGraphQLClient {

@Mutation
@Description("Create a new post")
public Post createPost(@Valid CreatePost createPostInput);
public Post createPost(CreatePost createPostInput);
}
10 changes: 1 addition & 9 deletions graphql-client/src/main/java/com/example/demo/PostSummary.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
package com.example.demo;

import lombok.*;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class PostSummary {
String title;
public record PostSummary(String title) {
}
7 changes: 5 additions & 2 deletions graphql-client/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
quarkus.log.level=INFO
com.example.demo.PostGraphQLClient/mp-graphql/url=http://localhost:8080/graphql
post-dynamic-client/mp-graphql/url=http://localhost:8080/graphql
quarkus.log.category."io.smallrye.graphql.client".level=TRACE
quarkus.log.category."io.smallrye.graphql.client".min-level=TRACE
quarkus.log.category."com.example".level=DEBUG
quarkus.smallrye-graphql-client.post-client-typesafe.url=http://localhost:8080/graphql
quarkus.smallrye-graphql-client.post-client-dynamic.url=http://localhost:8080/graphql
6 changes: 1 addition & 5 deletions graphql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<maven.compiler.release>21</maven.compiler.release>

<!-- dependencies -->
<quarkus.version>3.10.0.CR1</quarkus.version>
<quarkus.version>3.10.0</quarkus.version>

<skipITs>true</skipITs>
<lombok.version>1.18.32</lombok.version>
Expand All @@ -39,10 +39,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-graphql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
19 changes: 5 additions & 14 deletions graphql/src/main/java/com/example/demo/Comment.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
package com.example.demo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.microprofile.graphql.Id;
import org.eclipse.microprofile.graphql.Type;

@Data
@Builder
@Type
@NoArgsConstructor
@AllArgsConstructor
public class Comment {
@Id
String id;
String content;
public record Comment(
@Id
String id,
String content
) {
}
26 changes: 7 additions & 19 deletions graphql/src/main/java/com/example/demo/CreatePost.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
package com.example.demo;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.microprofile.graphql.Input;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Input
public class CreatePost {

@NotEmpty// add hibernate-validator extension, else bean validation dose not work.
@Length(min = 5)
String title;
public record CreatePost(
@NotEmpty// add hibernate-validator extension, else bean validation dose not work.
@Length(min = 5)
String title,
String content
) {

String content;
}
Loading

0 comments on commit 9005fcd

Please sign in to comment.