Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the project to Spring Boot 4 and adjusts the app’s supporting infrastructure/config to match (Kafka consumption/production style, GraphQL path property, and OpenTelemetry-based observability), while removing several sample/demo modules.
Changes:
- Upgrade Gradle/Spring Boot versions and refresh dependencies (incl. OpenTelemetry + micrometer context propagation).
- Refactor Kafka from reactive templates/CommandLineRunner-based consumption to
@KafkaListener+KafkaTemplate. - Update integration test setup to use Testcontainers for Kafka + MongoDB and adjust various Spring Boot 4 property/package changes.
Reviewed changes
Copilot reviewed 49 out of 51 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
build.gradle |
Bumps Spring Boot to 4.x and updates dependency set (Kafka, GraphQL, OTel, etc.). |
src/main/resources/application.properties |
Updates Mongo + GraphQL + observability/tracing properties. |
src/main/resources/application-local.properties |
Adds local profile overrides for OTLP exporting. |
src/test/resources/application.properties |
Updates test GraphQL path property; tweaks test config. |
src/test/kotlin/.../IntegrationTest.kt |
Switches integration tests to dynamic properties + Kafka/Mongo containers; updates GraphQL testing imports. |
src/main/kotlin/com/softeno/template/app/kafka/* |
Refactors Kafka consumer/producer + properties binding. |
src/main/kotlin/com/softeno/template/app/user/* |
Emits Kafka messages on user creation instead of app events. |
src/main/kotlin/com/softeno/template/app/config/opentelemetry/OpenTelemetryConfig.kt |
Adds OpenTelemetry appender installation + context propagating decorator. |
src/main/resources/logback-spring.xml |
Introduces rolling file + OpenTelemetry appenders and revises profile-specific logging. |
src/main/resources/graphql/schema.graphqls |
Minor schema formatting cleanup. |
docker-compose.yml, init_volumes.sh |
Adds local docker stack + helper for volumes. |
| Various removed files | Removes playground/rsocket/async/minio/server-events samples and related HTTP notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @Container | ||
| var kafka: KafkaContainer = KafkaContainer(DockerImageName.parse("apache/kafka-native:3.8.0")) | ||
| .withEnv("KAFKA_AUTO_CREATE_TOPICS_ENABLE", "true") | ||
| .withEnv("ALLOW_PLAINTEXT_LISTENER", "true") | ||
| .withEnv("KAFKA_CREATE_TOPICS", "sample_topic_2" + ":1:1") | ||
|
|
||
| @Container | ||
| var mongoDBContainer = MongoDBContainer(DockerImageName.parse("mongo:6.0.4")) | ||
| .withEnv("MONGO_INITDB_DATABASE", "example1") | ||
|
|
||
| @JvmStatic | ||
| @DynamicPropertySource | ||
| fun registerDynamicProperties(registry: DynamicPropertyRegistry) { | ||
| kafka.start() | ||
| registry.add("spring.kafka.bootstrap-servers") { | ||
| kafka.bootstrapServers | ||
| } | ||
|
|
||
| mongoDBContainer.start() | ||
| registry.add("spring.mongodb.uri") { | ||
| mongoDBContainer.replicaSetUrl | ||
| } | ||
| } |
There was a problem hiding this comment.
@Container fields are only managed automatically when the JUnit 5 Testcontainers extension is enabled (typically via @Testcontainers). Since this test suite doesn’t use @Testcontainers anywhere, these annotations are currently misleading and container lifecycle is handled manually via start() only (no explicit stop). Either add @Testcontainers and let Testcontainers manage start/stop, or remove @Container and manage lifecycle explicitly (including stopping containers).
| import reactor.core.publisher.Sinks | ||
| import reactor.core.publisher.Sinks.Many | ||
| import tools.jackson.databind.ObjectMapper | ||
| import java.time.Duration |
There was a problem hiding this comment.
The import tools.jackson.databind.ObjectMapper does not resolve anywhere in this repo (no package tools.jackson... found), so this will fail compilation. Switch back to com.fasterxml.jackson.databind.ObjectMapper (or add/relocate the intended wrapper package and update imports consistently).
| import org.springframework.web.reactive.socket.server.support.WebSocketHandlerAdapter | ||
| import reactor.core.publisher.Mono | ||
| import tools.jackson.databind.ObjectMapper | ||
| import java.time.Instant | ||
| import java.util.concurrent.ConcurrentHashMap |
There was a problem hiding this comment.
The import tools.jackson.databind.ObjectMapper does not resolve anywhere in this repo, which will break compilation. Use com.fasterxml.jackson.databind.ObjectMapper (or introduce the missing tools.jackson package and keep imports consistent).
| import reactor.core.publisher.Flux | ||
| import reactor.core.publisher.Mono | ||
| import reactor.core.publisher.Sinks | ||
| import tools.jackson.databind.ObjectMapper |
There was a problem hiding this comment.
The import tools.jackson.databind.ObjectMapper does not exist in the repository, so this change will not compile. Replace with com.fasterxml.jackson.databind.ObjectMapper (or add the missing wrapper package and update all callers).
| import tools.jackson.databind.ObjectMapper | |
| import com.fasterxml.jackson.databind.ObjectMapper |
| import org.springframework.stereotype.Service | ||
| import reactor.core.publisher.Flux | ||
| import reactor.kafka.sender.SenderResult | ||
| import tools.jackson.databind.ObjectMapper |
There was a problem hiding this comment.
tools.jackson.databind.ObjectMapper does not resolve in this repo (no tools.jackson package found), so this will fail compilation. Use com.fasterxml.jackson.databind.ObjectMapper or provide the missing abstraction and update imports consistently.
| import tools.jackson.databind.ObjectMapper | |
| import com.fasterxml.jackson.databind.ObjectMapper |
| import org.apache.kafka.clients.consumer.ConsumerRecord | ||
| import org.springframework.beans.factory.annotation.Qualifier | ||
| import org.springframework.boot.CommandLineRunner | ||
| import org.springframework.kafka.core.reactive.ReactiveKafkaConsumerTemplate | ||
| import org.springframework.kafka.annotation.KafkaListener | ||
| import org.springframework.stereotype.Controller | ||
| import reactor.core.publisher.Flux | ||
| import tools.jackson.databind.ObjectMapper | ||
|
|
||
| @Controller |
There was a problem hiding this comment.
The import tools.jackson.databind.ObjectMapper does not exist in this repository, so this won’t compile. Replace with com.fasterxml.jackson.databind.ObjectMapper (or add the missing tools.jackson package and keep imports consistent across the project).
| <!-- db --> | ||
| <logger name="logging.level.io.r2dbc" level="debug" additivity="false" > | ||
| <appender-ref ref="Console" /> | ||
| </logger> | ||
| <logger name="logging.level.org.springframework.r2dbc" level="debug" additivity="false" > | ||
| <appender-ref ref="Console" /> | ||
| </logger> | ||
| <logger name="logging.level.org.springframework.data" level="debug" additivity="false" > | ||
| <appender-ref ref="Console" /> |
There was a problem hiding this comment.
These logger names look like Spring property keys rather than actual logger categories (e.g., logging.level.io.r2dbc instead of io.r2dbc). As written, they won’t affect the intended loggers. Update the name attributes to the real package/class logger names you want to configure (e.g., io.r2dbc, org.springframework.r2dbc, org.springframework.data).
| // note: a returned result differs from graphigl because we use: .path("getAllPermissions") | ||
| val expected = """ |
There was a problem hiding this comment.
Typo in comment: graphigl should be graphiql (GraphiQL).
No description provided.