https://kotlinlang.org logo
Join Slack
Powered by
# server
  • s

    sdeleuze

    05/26/2025, 6:20 AM
    FYI https://kotlinlang.slack.com/archives/C0B8ZTWE4/p1748240406425669
    kodee loving 7
    👍 3
  • a

    Anonymike

    05/26/2025, 11:19 PM
    Possible Kotlin 2.1.21 Issue: Has anyone run into the following error with Kotlin 2.1.21? My coworker can build our projects after upgrading, but I cannot and we haven't yet been able to identify the difference. I am able to build projects if I downgrade to 2.1.20. We use gradle wrapper and are on the same Gradle versions as well. I know this particular feature relates to changes made in these versions. We're on Gradle 8.14.1 now, but have tried all the way back to 8.12.1.
    Unable to find method ''org.gradle.internal.buildoption.BuildOption$Value org.gradle.api.internal.StartParameterInternal.getIsolatedProjects()''
    Small addition: This occurs in all of my projects...server, simple cli utilities, libraries, etc. Anywhere I use
    2.1.21
    I get the same error. Thanks for any help in advance.
    k
    e
    • 3
    • 10
  • n

    nadi

    05/27/2025, 6:33 AM
    hi there. we have a kotlin library that we use from a scala project. is it possible to instantiate a value class of kotlin from the scala class that uses this library?
  • m

    Mark lindsay

    05/27/2025, 4:42 PM
    Hello all and good morning I am starting to get to know Kotlin… I am also in the process of connecting many platforms as well with kotlin JavaScript node.js and more…even though GitHub Apple shortcuts etc
    👋 2
  • l

    louiscad

    05/28/2025, 9:04 AM
    Hello, what would be the reasons for you to pick Go over Kotlin for a backend project, and vice-versa? Asking for friends 🙂
    o
    k
    +5
    • 8
    • 18
  • e

    Edgar Avuzi

    05/30/2025, 8:16 AM
    Stack Overflow Developer Survey 2025 is open! So, as a community, we can fill it out and indicate that we use Kotlin for backend development — influencing the overall statistics and maybe even pushing Kotlin up in the rankings 🤣. The JetBrains survey is open as well
    K 12
    🚀 1
    • 1
    • 1
  • b

    Bernhard

    06/02/2025, 6:56 AM
    I'm looking at a kotlin sdtlib dependency in our java projects (pulled in by okhttp3) at version 1.4.10; I suppose I can upgrade to 1.9.0. is there a good overview over which version runs on which JVM version?
    ✅ 1
    c
    j
    l
    • 4
    • 11
  • m

    Mane De Mel

    06/03/2025, 1:00 PM
    Thanks all.
  • s

    Satyam Gondhale

    06/04/2025, 2:33 PM
    Can anyone suggest best resources to learn Springboot with Kotlin
    m
    h
    • 3
    • 2
  • m

    Mikhail Nikitin

    06/09/2025, 9:59 AM
    Hi! It would be awesome if JetBrains made Kotlin themed sticker pack for telegram K
    K 15
  • m

    Mohammad Zaki

    06/13/2025, 1:09 PM
    Hi Team , I just migrated to ktor 3.1.3 from 2.3.12 but not sure why call.receive is not working like its not converting my json into data class . This is the extension function i was using earlier but now its not working .
    Copy code
    suspend inline fun <reified T : Any> PipelineContext<*, ApplicationCall>.getBodyContent(): T {
        return call.receive()
    }
    i cant access it inside post block. Can anyone help
    h
    v
    • 3
    • 6
  • m

    Mohammad Zaki

    06/13/2025, 1:32 PM
    Does Koin 4.1 supports Ktor Server 3.1.3 ?
    l
    • 2
    • 2
  • y

    Yorgos S.

    06/16/2025, 8:46 AM
    Just released the new version of
    actor4k
    .
    actor4k
    is a small actor system written in kotlin using Coroutines. The actor model is a design paradigm for building concurrent systems where the basic unit of computation, known as an actor, encapsulates its own state and behavior and interacts with others solely through asynchronous message passing. Each actor processes messages sequentially, which simplifies managing state changes and avoids common pitfalls like race conditions and deadlocks that arise with traditional multithreading approaches. This model is particularly useful for highly concurrent, distributed, and fault-tolerant systems. Its scalability and resilience come from the ability to isolate errors within individual actors through supervision strategies, making it a fitting choice for applications such as real-time data processing, microservices architectures, and any system that requires robust fault isolation and maintainability. Check it out here: https://github.com/smyrgeorge/actor4k
    👍 5
  • k

    Kanon

    06/17/2025, 10:21 PM
    Hi, everyone 👋 I released a generic Value Object library inspired by Zod for Kotlin 🙌 This is no dependence 3rd party libraries. please give me feedback and GitHub Star 💫😭 https://github.com/ysknsid25/iolite
    👏 1
    m
    • 2
    • 3
  • n

    Nicolas

    06/18/2025, 12:16 PM
    Hello Teams 😄 and Thank you for accepting me 😄 I am doing my server with ktor and I used webSocket to do a chat, I hope my question will not be dumb because I am iOS developer at firt 😄 I have the following code to set up my WebSocket with ktor. My problem is the following: if I turn off the internet on the mobile side (iOS) after setup a connection with the socket for about 3 minutes, my socket is no longer active, probably because the ping/pong fails on front side. However, the finally block on server side is often called a long time ago, so the webSocket is close after 20 minutes. How can I prevent this memory leak? and to be sure that after 3minute offline from the client, the webSocket will be remove from my server please. I Have setup the ping pong like this
    Copy code
    fun Application.configureWebSocket(){
        install(WebSockets) {
            pingPeriod = 15.seconds
            timeout = 15.seconds
            maxFrameSize = kotlin.Long.MAX_VALUE
            masking = false
    
        }
    }
    Copy code
    routing {
        webSocket("ws") {
            val token = call.request.queryParameters["token"]
            if (token == null) {
                close(CloseReason(CloseReason.Codes.VIOLATED_POLICY, "No Token"))
                return@webSocket
            }
    
            val decodedJWT = try { JwtFactory.buildverifier().verify(token) }
            catch (e: Exception) {
                close(CloseReason(CloseReason.Codes.VIOLATED_POLICY, "Invalid Token: ${e.message}"))
                return@webSocket
            }
    
            val userId: UUID = try { UUID.fromString(decodedJWT.getClaim(JwtClaimConstant.claimUserId).asString())  }
            catch (e: Exception) {
                close(CloseReason(CloseReason.Codes.VIOLATED_POLICY, "Invalid Token: ${e.message}"))
                return@webSocket
            }
    
            val sessionId = decodedJWT.id?.let {
                runCatching { UUID.fromString(it) }.getOrNull()
            } ?: run {
                close(CloseReason(CloseReason.Codes.VIOLATED_POLICY, "Invalid or missing sessionId (jti)"))
                return@webSocket
            }
            <http://logger.info|logger.info>("$userId is connected")
    
            try {
                println("$userId start")
                incoming.consumeEach {
                    when (it) {
    
                        is Frame.Text -> {
                            val text = it.readText()
                            println("tototot $userId Received: $text")
                        }
                        is Frame.Close -> {
                            println("tototot $userId WebSocket closed by server with reason: ${it.readReason()}")
                        }
                        is Frame.Ping -> {
                            println("tototot $userId ping: $it")
                        }
                        is Frame.Pong -> {
                            println("tototot $userId pong: $it")
                        }  else -> {
                            println("tototot $userId else: $it")
                        }
                    }
    
    
                }
            } catch (e: Exception) {
                println("$userId error $e")
             } finally {
                println("$userId finally remove")
            }
    
            println("$userId end")
        }
    }
    and I found something weird If I open a websocket on my iOS phone, turnoff the internet (and close my phone) I keep logging this on KTOR: io.ktor.websocket.WebSocket - WebSocket Pinger: received valid pong frame Frame PONG For me if I close my phone the webscket should try a ping and should not receive a pong and close, For me the goal of ping pong is to avoid all this. I am not sure if I have doing everything good 🙂 I am hosting my server on Render Thank you in advance for your time
  • d

    dave

    06/18/2025, 12:27 PM
    👋 Hey everyone - happy Wednesday! We've got some news about what we've been cooking up over at http4k towers... https://http4k.org/news/ai_without_tests_is_just_expensive_random_number_generation/
    http4k 1
    kodee happy 1
    e
    • 2
    • 3
  • n

    Nicolas

    06/23/2025, 9:27 AM
    hello 😄 any idea 😢 ? because I don't know if it's an issue or me who don't know how to use websocket :"(
    h
    • 2
    • 2
  • a

    Asadullah Nadeem

    06/24/2025, 8:43 AM
    Hello
    👋 5
    kodee welcoming 6
  • b

    Bharat Kumar

    06/26/2025, 10:26 AM
    Hi guys how do you do authentication for ktor server backend do you use any libs or manually do it with ktor auth. Also what is the best way if I want to have oauths and normal email password auths too ?
    d
    s
    +2
    • 5
    • 4
  • a

    Alina Dolgikh [JB]

    06/27/2025, 12:13 PM
    Hi everyone! 📹 We’re hosting a livestream together with Azul, where Simon Vergauwen (JetBrains Developer Advocate) and Jiří Holuša (Azul Director of Product Management) will show you how to get the most out of the JVM with Kotlin and Azul Runtime. 💬 We’ll be chatting during the livestream, so feel free to ask your questions! Save the date and register for a reminder: 📆 July 16 🕓 4:00 PM UTC https://info.jetbrains.com/kotlin-livestream-july16-2025.html
    👀 2
  • b

    bk9735732777

    07/03/2025, 6:36 AM
    Hi guys i am having trouble with deploying my ktor backend to render via Docker Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf I am getting this error.
    Copy code
    # Stage 1: Cache Gradle dependencies
    FROM gradle:latest AS cache
    RUN mkdir -p /home/gradle/cache_home
    ENV GRADLE_USER_HOME=/home/gradle/cache_home
    COPY build.gradle.* gradle.properties /home/gradle/app/
    COPY gradle /home/gradle/app/gradle
    WORKDIR /home/gradle/app
    RUN gradle clean build -i --stacktrace
    
    # Stage 2: Build Application
    FROM gradle:latest AS build
    COPY --from=cache /home/gradle/cache_home /home/gradle/.gradle
    COPY --chown=gradle:gradle . /home/gradle/src
    WORKDIR /home/gradle/src
    # Build the fat JAR, Gradle also supports shadow
    # and boot JAR by default.
    RUN gradle buildFatJar --no-daemon
    
    # Stage 3: Create the Runtime Image
    FROM amazoncorretto:22 AS runtime
    EXPOSE 8080
    RUN mkdir /app
    COPY --from=build /home/gradle/src/build/libs/*.jar /app/ktor-docker-sample.jar
    ENTRYPOINT ["java","-jar","/app/ktor-docker-sample.jar"]
    This is my docker file Thread in Slack Conversation
    g
    • 2
    • 4
  • o

    Ohiorenua Aigboje

    07/08/2025, 12:47 PM
    I made a tutorial on how to create an MCP server with kotlin. Will I be breaking the rules if I post the youtube link here
    j
    p
    • 3
    • 5
  • o

    Ohiorenua Aigboje

    07/14/2025, 6:39 AM
    Can someone explain it to me. I don't get the connection of compose wasm to CMP. Compose wasm is to build the UI framework for web, but does it have a backend logic. If I create a project that uses, Android, Ios, WASM, and the app size is 50MB will the wasm also be 50mb. most of those code should go to the backend, right? how does wasm know and communicate with the backend( the logic of the code)
    b
    • 2
    • 5
  • j

    Jens Alfke

    07/19/2025, 6:31 PM
    Is multiplatform Ktor really a practical technology yet? I’ve gotten the basics working and have a basic HTTP server with HTML DSL; then this morning I tried to set up static routes to serve my static content … only to find that this functionality, and the entire io.ktor.server.http.content module, is JVM-only for some reason. (And the web page does not call this out, so I only found out when I tried to use the API in my code.) Serving static files is rock-bottom basic functionality for any web server I’ve ever used. If it’s not multiplatform in Ktor, what else isn’t? This has me doubting my decision to use Kotlin for this project (which cannot depend on the JVM.)
    e
    d
    +2
    • 5
    • 15
  • j

    joseph_ivie

    07/23/2025, 2:54 PM
    We built a server framework (https://github.com/lightningkite/lightning-server) that's been working out really well for us in production. However, I think adoption by others would be hampered by a few issues. One of the advantages of the framework is that it abstracts the common services servers depend on (database, cache, email, SMS, file systems) in a way that makes it really easy to both run your server locally for testing and deploy it to traditionally difficult targets (such as AWS Lambda / API Gateway). It also generates deployment terraform for you based on your server definition. If I broke out these service abstractions into a different library for use with Ktor and other libraries (like http4k), would anyone be interested?
    • 1
    • 1
  • j

    Joel Denke

    08/04/2025, 3:13 PM
    Is it easy to launch your own Kotlin Ktor server from scratch act as proxy to Firebase Admin SDK, easy as in can do with AI agent or generate most of the boilerplate? It doesnt have to be perfect, but good enough to test if its worth it. Just deploy directly to GCP or something. Or something equivalent of that. Can be Apollo GraphQL or whatever.
    ✅ 1
    m
    s
    • 3
    • 194
  • m

    MattF

    08/05/2025, 12:29 PM
    what inspections or compiler options can one enable to avoid something like this happening where the aa & bb line is silently discarded due to a second '&&' missing at the end... val matched = list.find { aa && bb // accidentally deleted a second && at the end of line somehow cc } this doesn't show any error or warning or even any hints in the IDE, it's a bug that really thrown me and I do worry about this happening again although I understand whats happening its a concerning silent discard .
    e
    • 2
    • 2
  • m

    Mohammad Zaki

    08/05/2025, 6:45 PM
    Hi Team , I have a Kotlin Notebook code cell. I have this api. i want to set a timeout here, the default is 10s. I don't want that.
    Copy code
    val response = http.get("<http://127.0.0.1:8080/v1/flashcards?topic=Something&type=quiz&difficulty=hard>")
    response.bodyAsText()
    Can anyone help?
    k
    • 2
    • 1
  • j

    Joel Denke

    08/07/2025, 5:20 AM
    I finally managed to deploy container and run on Google Cloud, but all containers run default private and require OAuth tokens. Whats the recommended approach when integrate that server into a client frontend later on, to protect that token. It has to embed some kind of long lived token somewhere. Maybe possible to use Firebase Auth or something?
  • j

    JonasBecker

    08/14/2025, 10:03 AM
    💼 Full-Stack | Python | AI | Web | Bots | Blockchain Developer 🧠 Open for new projects – freelance, contract, or collaborations! Hi everyone! I'm an experienced full-stack developer with a strong background in: 🚀 Core Stack: Languages: Python, JavaScript/TypeScript Frameworks: FastAPI, Flask, Django, React, Next.js, Vue/Nuxt AI/ML: Custom models, NLP, computer vision, OpenAI integration Bots: Telegram, Discord, automation bots, betting bots, advanced web scraping Blockchain: EVM-based chains (Ethereum, BSC, Polygon), MEV bots, arbitrage, smart contracts (Solidity) Databases: PostgreSQL, MySQL, MongoDB DevOps: Docker, GitHub Actions, CI/CD, AWS, DigitalOcean 💡 What I bring to the table: Clean, scalable architecture and production-grade code Strong problem-solving with focus on automation and performance Clear communication, fast iterations, and deep understanding of business goals Proven experience delivering real-world platforms, tools, and bots 🔍 Available for: Startup MVPs and SaaS builds Custom bots (Telegram, blockchain, automation, data scraping) AI-powered apps and backend APIs Long-term technical partnerships 📬 DM me if you're looking for a reliable, skilled developer. Happy to share portfolio, GitHub, or real project references!
    🤡 4
    🚫 22
    k
    • 2
    • 1