Using Ktor 3.0 with All the Shiny Things • Garth Gilmour • GOTO 2024

Learn how Ktor 3.0 brings powerful new features like native compilation, multiplatform support, built-in testing tools, and modern protocol integrations to Kotlin web development.

Key takeaways
  • Ktor 3.0 emphasizes a “no magic” philosophy - all features must be explicitly enabled through plugins, avoiding convention over configuration

  • Testing is a core strength with built-in support for route testing, mock engines, and IDE integration that can auto-generate tests for routes

  • Full multiplatform support allows compiling Ktor applications to JVM, Native (iOS, Android) and WebAssembly targets

  • Dependency injection is supported through integration with libraries like Koin, with ability to scope components to requests and support multiple containers

  • Built-in support for popular protocols and patterns:

    • GraphQL with schema generation
    • WebSockets with JSON serialization
    • OpenTelemetry integration for observability
    • Request retry functionality with backoff policies
  • Kotlin Notebook integration enables rapid prototyping and experimentation with Ktor without setting up full projects

  • Native compilation support produces fast-starting executables without requiring a JVM

  • Strong plugin ecosystem with a registry for community-contributed plugins that can achieve official status

  • Focused on being minimal, flexible and fast while maintaining explicit control rather than magic conventions

  • Roadmap includes gRPC support, vendor-agnostic DI containers, and replacing bespoke networking with KotlinX I/O library