:ktor-new::kodee-happy: Ktor 3.0 is here! Start b...
# announcements
a
ktor newkodee happy Ktor 3.0 is here! Start building your new projects with Ktor 3.0 and take advantage of these new features: 🟣 Improved performance with kotlinx-io 🟣 Server-Sent Events (SSE) support 🟣 Serving static resources from ZIP files 🟣 Ktor client for Kotlin/Wasm ➡️ Read our blog post to dive deeper into the updates.
🙌🏾 1
❤️ 9
ktor 14
K 9
🎉 40
K 4
ktor new 3
🙌 16
K 91
s
This feels really big! 💪 Bigger even than going from Ktor 1 to 2, because of WASM 🙂
kodee greetings 6
p
Just wonder, what are the benefits of SSE against web sockets?
r
SSE is one-way from server to client and usually relies on HTTP protocol. Web Sockets are two-way and while they start with HTTP, they work as a different protocol. I see it as more of different use cases than properly pros vs cons situation.
p
Then we can consume SSE from Spring Webflux endpoints too :D
f
“(…) Some tests saw over 90% improvement [in performance] (…)” 🎉 That’s great 😄 !
r
Does it include any changes to DI with Koin? I noticed that Koin is no longer in the Ktor project generator
a
Hi! Is there any expected date for open telemetry integration?
e
Hey @Renan Kummer, it looks like a bug. Let me check
👍 1
👀 1
@Antonio Acuña Prieto, it should be already in place: https://github.com/ktorio/ktor-samples/tree/main/opentelemetry
K 1
a
In Ktor 2.3.12, I encountered an issue where the token wasn’t immediately updated upon login. Here is the relevant part of my code:
Copy code
install(Auth) {
    bearer {
        loadTokens {
            BearerTokens(
                accessToken = sessionHandler.getToken().first(),
                refreshToken = ""
            )
        }
    }
}
To resolve this, I added the following workaround to clear the token when a login request is made:
if (body is LoginRequest) {
Copy code
httpClient.plugin(Auth).providers.filterIsInstance<BearerAuthProvider>().first()
        .clearToken()
}
However, after upgrading to Ktor 3.0.0, the providers method is now unresolved. How can I adapt this code to work with Ktor 3.0.0? Any advice or suggestions on how to handle this change would be greatly appreciated.