-
Notifications
You must be signed in to change notification settings - Fork 29
add support for spring-boot 4x #480 #481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Spring Boot 4.x by creating a new kediatr-spring-boot-4x-starter module, following the same pattern as existing Spring Boot 2x and 3x starters. The implementation mirrors the Spring Boot 3x starter structure with autoconfiguration support.
- Created a new Spring Boot 4x starter module with autoconfiguration
- Updated project settings to include the new starter module
- Removed unused autoconfigure dependency from Spring Boot 3x starter
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle.kts | Added the new kediatr-spring-boot-4x-starter module to the project |
| gradle/libs.versions.toml | Added Spring Boot 4.0.0 version and related dependency declarations |
| projects/kediatr-spring-boot-4x-starter/build.gradle.kts | Created build configuration for the 4x starter module |
| projects/kediatr-spring-boot-4x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt | Implemented autoconfiguration for Spring Boot 4x integration |
| projects/kediatr-spring-boot-4x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt | Implemented Spring bean provider for dependency injection |
| projects/kediatr-spring-boot-4x-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports | Registered autoconfiguration for Spring Boot 3+ style discovery |
| projects/kediatr-spring-boot-4x-starter/src/test/kotlin/com/trendyol/kediatr/spring/MediatorTests.kt | Added comprehensive test coverage using shared test cases |
| projects/kediatr-spring-boot-3x-starter/build.gradle.kts | Removed unused autoconfigure dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| override fun <T> getSingleInstanceOf(clazz: Class<T>): T = applicationContext | ||
| .getBeanNamesForType(clazz) | ||
| .map { applicationContext.getBean(it) as T } | ||
| .single() |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of getSingleInstanceOf() differs from the Spring Boot 2x and 3x versions, which use the simpler applicationContext.getBean(clazz). This version retrieves bean names, maps them to instances, and calls .single(), which may throw an exception if there are multiple beans of the same type. The 2x/3x approach delegates to Spring's bean resolution logic which properly handles primary beans and qualifiers. Unless there's a specific Spring Boot 4.x compatibility reason for this change, it should be aligned with the existing implementations for consistency.
| override fun <T> getSingleInstanceOf(clazz: Class<T>): T = applicationContext | |
| .getBeanNamesForType(clazz) | |
| .map { applicationContext.getBean(it) as T } | |
| .single() | |
| override fun <T> getSingleInstanceOf(clazz: Class<T>): T = applicationContext.getBean(clazz) |
589878e to
b95085f
Compare
fixes #480