feat(ktor-starter): add Koin DI integration#256
Closed
fireboy1919 wants to merge 10 commits intoairbnb:mainfrom
Closed
feat(ktor-starter): add Koin DI integration#256fireboy1919 wants to merge 10 commits intoairbnb:mainfrom
fireboy1919 wants to merge 10 commits intoairbnb:mainfrom
Conversation
rstata
reviewed
Dec 23, 2025
| | || || || || || || || || | | ||
| | || || || || || || || || | | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| GraphQL Data Pipeline Framework |
Collaborator
There was a problem hiding this comment.
I don't know if i like "Data Pipeline Framework" -- how about "Data-Oriented Service Mesh"?
rstata
reviewed
Dec 23, 2025
|
|
||
| dependencyResolutionManagement { | ||
| repositories { | ||
| mavenLocal() |
Collaborator
There was a problem hiding this comment.
i don't think we should check this in.
rstata
reviewed
Dec 23, 2025
| response.status shouldBe HttpStatusCode.OK | ||
| // Verify we get ASCII art data (contains GraphQL framework text) | ||
| val body = response.bodyAsText() | ||
| body.contains("GraphQL Data Pipeline Framework") shouldBe true |
Collaborator
There was a problem hiding this comment.
change here too if you change it.
rstata
reviewed
Dec 23, 2025
deec9e6 to
81a1337
Compare
added 10 commits
January 7, 2026 16:06
Add a new demo application demonstrating Micronaut integration with Viaduct's serve module. Key features: - MicronautServerProvider: Starts only Micronaut's ApplicationContext (DI container) without the HTTP server for fast development iteration - MicronautTenantCodeInjector: Bridges Micronaut DI with Viaduct resolvers - ViaductConfiguration: Factory for creating Viaduct bean with DI support This enables fast startup times during development by avoiding full Micronaut HTTP server initialization while still providing full dependency injection for resolvers. Structure: - serve/MicronautServerProvider.kt - ViaductServer integration - injector/ViaductConfiguration.kt - Viaduct bean factory - injector/MicronautTenantCodeInjector.kt - DI bridge - resolvers/ - Sample resolver implementations
…startup Use ApplicationContext.builder().packages() to limit Micronaut's classpath scanning to only the necessary packages: - com.example.viadapp.injector (ViaductConfiguration, TenantCodeInjector) - com.example.viadapp.resolvers (Resolver implementations) This avoids loading controllers, filters, HTTP server components, and other beans that aren't needed for serve mode, resulting in faster startup times.
Move serve runtime code from gradle-plugins/application-plugin to a standalone serve/ module that publishes com.airbnb.viaduct:serve artifact. This enables micronaut-starter and other apps to depend on the serve runtime classes (ViaductServerProvider, ViaductServerConfiguration) when building in isolation with mavenLocal. - Create serve/ module with viaduct-publishing convention - Move serve source and test files from application-plugin - Update application-plugin to depend on libs.viaduct.serve - Add serve module to included-builds/core/settings.gradle.kts - Add dependency substitution in root settings.gradle.kts - Update micronaut-starter to use mavenLocal and correct version
- Rename ViaductServerProvider interface to ViaductProvider - Rename MicronautServerProvider to MicronautViaductProvider - Reorganize micronaut-starter with dev/production source sets: - Production code in src/main/kotlin/.../production/ - Dev-only code in src/dev/kotlin/.../dev/ - viaduct-serve dependency only included in dev builds - Update version to 0.16.0-SNAPSHOT - Add micronaut-starter to version sync scripts and tests - Update documentation with new structure and build configuration
…ector Implements Koin-based dependency injection for the ktor-starter demo app, demonstrating how to use a DI framework as the source of truth for resolver discovery and instantiation (analogous to Spring in starwars demo). Key components: - KoinTenantCodeInjector: implements TenantCodeInjector, delegates to Koin - KoinTenantResolverClassFinder: returns resolvers from explicit set (no scanning) - KoinTenantResolverClassFinderFactory: creates finders for packages - viaductModule: registers Viaduct singleton configured with Koin-based DI - resolversModule: registers services and resolver factories - resolverClasses set: explicit registry for resolver discovery Example implementation: - AsciiArtService: loads ASCII art from resources - AsciiArtResolver: uses constructor injection via Koin - asciiArt query in GraphQL schema To add a new resolver: 1. Add class to resolverClasses set 2. Register as factory in resolversModule
Remove KoinTenantResolverClassFinder and KoinTenantResolverClassFinderFactory. Use Viaduct's default classpath scanning for resolver discovery. Koin is now only used for instantiation via KoinTenantCodeInjector, which enables constructor injection of dependencies into resolvers.
Register Koin instance itself in the module so it can be injected. Use get() for all dependency injection rather than explicit getKoin() calls.
- Change tagline to "Data-Oriented Service Mesh" - Remove mavenLocal() from repository configurations
Remove property-based injection that caused JVM signature clash between the generated getter and the interface method getViaduct().
6da9289 to
cf67faa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PUBLIC
feat(ktor-starter): add Koin DI integration with custom TenantCodeInjector
Implements Koin-based dependency injection for the ktor-starter demo app, demonstrating how to use a DI framework as the source of truth for resolver instantiation.
Key components:
Test Plan
./gradlew buildsucceeds for ktor-starter./gradlew buildsucceeds for micronaut-starter