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

    Vishal Reddy

    04/07/2025, 12:56 PM
    I just saw that the latest Ktor server release CIO engine supports server side wasm. Anyone know a gradle setup example for this project?
    j
    • 2
    • 1
  • w

    wakingrufus

    04/09/2025, 1:15 PM
    https://www.tiobe.com/tiobe-index/ They only mention Kotlin on android and iOS and say its only for 1 platform.... Totally sleeping on backend kotlin. IME it is becoming more and more common to meet people doing back end kotlin. I think maybe tiobe is not properly detecting JVM backend work using a hybrid of java/kotlin
    kodee sad 10
    🥱 1
    o
    g
    +5
    • 8
    • 11
  • s

    Shadman

    04/27/2025, 5:41 PM
    So I have a general question. 🙃 Can I use
    Gradle Flavors
    instead of feature based modules for a
    ktor
    backend and I still have the advantages of a real
    microservice
    structure (For example independent deploy)? I don't think so right?🤔 Can't we somehow trick it? Like giving different port for each
    flavor
    , for both server port and database port?
    h
    • 2
    • 1
  • u

    배규민

    05/06/2025, 7:45 AM
    Hi everyone! I’d like to share Documentify, an open-source tool that simplifies creating OpenAPI specs using Kotlin DSL. It combines the strengths of Swagger and RestDocs for intuitive and efficient documentation, without the complexity of conventional RestDocs. Feedback and contributions are welcome! (and stars 🤣) https://github.com/BGMSound/documentify
    📚 1
  • m

    Mohammad Zaki

    05/11/2025, 9:46 AM
    Hi Team, I am trying to implement web socket through ktor server . Its working fine but its not connecting to android app which is using ktor client. I am getting this error : ws://ip-here8080/clipboard/myRoom Operation not permitted
    a
    m
    m
    • 4
    • 4
  • o

    Olufemi Adeojo

    05/13/2025, 10:00 PM
    Hi all, what do you use for linting Kotlin projects?
    j
    t
    +5
    • 8
    • 16
  • o

    Olufemi Adeojo

    05/13/2025, 10:01 PM
    What can I use to auto fix linting issues in the project from the command line?
    s
    r
    • 3
    • 2
  • o

    Olufemi Adeojo

    05/13/2025, 10:02 PM
    What would work to format on save with a code editor and what code editors would it work on?
  • 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