https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
server
  • u

    unnsse

    01/16/2020, 8:13 PM
    What are people's thoughts about ktor? https://ktor.io/ What are the standard libraries people use for backend dev using Kotlin, it just Spring Boot? If there some good Kotlin backend open source libs that people can point me to, that would be much appreciated! Happy programming!
    👍 2
    f
    j
    +12
    • 15
    • 19
  • m

    Martins Joseph

    01/17/2020, 10:15 PM
    Hello, I am having issues setting up auto-reload for my Ktor
    n
    s
    m
    • 4
    • 6
  • f

    Felistas Ngumi

    02/04/2020, 10:41 AM
    My build.gradle file
    dependencies {
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
        implementation "io.ktor:ktor-server-netty:$ktor_version"
        implementation "ch.qos.logback:logback-classic:$logback_version"
        testImplementation "io.ktor:ktor-server-tests:$ktor_version"
    }
    • 1
    • 1
  • t

    Timur Atakishiev

    02/04/2020, 3:25 PM
    Hi guys, I have a following
    DTO
    data class CompanyCreateDto(
        val name: String,
        val address: String
    )
    The dto is send by front end for me. Problem is when the name is null kotlin throws an exception that can not be handled. Is it any library or any approach, that provide an ability to give a custom exception with text like
    name can not be null
    for example
    m
    a
    +2
    • 5
    • 4
  • t

    Tim Schraepen

    02/05/2020, 9:44 PM
    Hi everyone. I am in desperate need of your help. Who @here has references for (belgian) projects done in Kotlin and wants to share these references? I’m trying to build a stronger case to start using Kotlin as a strategy for the company I’m working for. Looking ideally at Kotlin projects as replacement for (typical) Java backend projects.
    m
    c
    +2
    • 5
    • 18
  • t

    Tim Schraepen

    02/06/2020, 6:02 AM
    Backends indeed. That’s why I posted it here. What’s SRE and DS?
    c
    • 2
    • 2
  • j

    James Richardson

    02/06/2020, 7:38 AM
    https://stackshare.io/kotlin ?
    t
    • 2
    • 2
  • b

    Brindasanth

    02/07/2020, 11:38 PM
    Hi Team, Is there any default distributed lock implementation in ktor ?
    e
    t
    +2
    • 5
    • 40
  • b

    Bruno_

    02/10/2020, 9:16 AM
    I have quite a bit of domain controllers (e.g. NetworkController) and one CsvExportController, is that a good idea? in other words, would you place exportNetworkCsv in this export controller or in the network one?
    • 1
    • 1
  • h

    Harart

    02/10/2020, 1:48 PM
    Hi guys! i am android developer for 2 years. Should i learn ios. is it good be developer on both platform ios and android?
    :stackoverflow: 2
    :trollface: 1
    m
    k
    n
    • 4
    • 13
  • a

    asad.awadia

    02/11/2020, 1:12 AM
    For those who answered yes - 1) how many servers are you using? 2) What framework? [spring/jboss etc] 3) How is the CPU/Memory looking on the servers? 4) Is the DB scaling well alongside the app?
    d
    p
    +4
    • 7
    • 14
  • n

    nicholasnet

    02/15/2020, 6:56 PM
    Anybody using Spring R2bc with Kotlin. I am just wondering how to use DB transaction using coroutine.
    ☝️ 1
    r
    s
    m
    • 4
    • 4
  • d

    Desmond Xu

    02/18/2020, 9:15 AM
    hello world. So I have this debug session going on and my 'it' is a Context2, but it.get(SecurityContext::class) is getting evaluated to null. what am i missing?
    • 1
    • 2
  • h

    Harun Artın

    02/21/2020, 8:43 PM
    Hello everyone. I am developing an online quiz application. Do you think Firebase is suitable for real-time multiplayer? The game I want to do will be like a quiz up application. Is there a platform you recommend if Firebase is not suitable? i didnt find any example. I'm a little nervous about latency. I couldn't decide between websocket or firebase. what is your suggestion?
    a
    • 2
    • 1
  • e

    earroyoron

    02/24/2020, 6:34 AM
    Reading from a file with
    File.readLines
    is discouraged for big files. I suppose is just because it builds a
    List
    so of course a
    Sequence
    is preferred. But, does this advice apply also to:
    val stream: Flow<String> = File(arguments.filename).readLines().asFlow()
    ? Not sure if the composer maybe optimise this to not have the full list before flowing,...
    f
    c
    • 3
    • 3
  • a

    Amardeep

    02/24/2020, 8:11 PM
    Hi, I am writing a Spring Boot Kotlin micro service. I intend to use spring reactive stack along with Kotlin Flows/Coroutines. I want to log all incoming http request and response body in my micro service. What would be an appropriate approach to do that? Is writing a Filter which intercepts the request/response and reads the stream and then log it is safe and recommended? What other options I can explore? Thanks in advance
    g
    • 2
    • 4
  • d

    David Gethers

    03/02/2020, 3:38 PM
    Does any one here have any experience working with
    Micronaut
    ? I need a bit of help writing tests for Controllers. Examples: How do you write a test to ensure a redirect happens? How do you mock header information?
    s
    • 2
    • 1
  • r

    rrva

    03/05/2020, 10:07 AM
    If I have a ktor client call which receives a List of objects in JSON, how do I pass in a serializer so that List<Foo> can be deserialized?
    e
    • 2
    • 1
  • s

    Slackbot

    03/06/2020, 9:25 PM
    This message was deleted.
    f
    m
    • 3
    • 6
  • m

    Max

    03/08/2020, 1:13 AM
    Hello again, does anyone have some experience with KTor and building custom servers? I'm trying to create a grpc microservice, but have trouble with adding a module.
    n
    g
    +2
    • 5
    • 6
  • c

    Chills

    03/17/2020, 8:29 AM
    who is using ktor in india , or even kotlin , afraid to invest my career on it.
    l
    s
    +2
    • 5
    • 5
  • c

    Cosmin Victor Celea

    03/20/2020, 8:42 AM
    Does anyone have some hints on how to configure a server(JETTY) to require SSL in http4k?🆘
    d
    • 2
    • 19
  • v

    Victor

    03/22/2020, 4:44 PM
    Is Ktor going to support HTTP/3 & QUIC?
    s
    t
    • 3
    • 2
  • m

    maxmello

    04/11/2020, 3:18 PM
    Hey guys, I have a question regarding REST APIs and Kotlin. Normally, we define mutability of properties through `val`and
    var
    . But when a model is stored in a database and edited in a frontend, we (de-)serialize the model, which removes the usefulness of
    val
    , because objects are newly created when deserialized (e.g. from a JSON request body). In my
    PUT
    endpoints, I want to make sure only the fields are updated which are actually mutable, so right now I manually get the old version of the model from the database and update mutable fields one by one manually from the new instance. For me, this has 2 problems: If I only update the var fields, the client might wonder why the other fields did not update on the next request. Secondly, when the model changes, it is easy to forget updating the manual updating code. Anybody got a better approach to this? Do you prever PUT endpoints per mutable property instead?
    s
    a
    +3
    • 6
    • 9
  • g

    Gregor Zeitlinger

    04/20/2020, 7:10 AM
    The OpenTelemetry project is trying to standardize on a context propagation mechanism - and I've found https://github.com/Kotlin/kotlinx.coroutines/issues/284 and would like to know more about it
    e
    • 2
    • 12
  • t

    Taha

    04/20/2020, 12:49 PM
    Hello All, This is a question not entirely related to Kotlin. I am implementing a support center in my web app where users can create an track tickets/incidents/cases. I am experimenting with Zendesk Support API. So far it is doing the job just fine but I wanted to ask here if you guys have used it or can recommend other solutions with which you’ve had a positive experience :)
    m
    • 2
    • 2
  • p

    Pypdeveloper

    04/26/2020, 2:40 PM
    Can anyone tell me what does server side programming mean? And where can I start with Kotlin?
    d
    • 2
    • 1
  • g

    Geoffrey De Smet

    04/27/2020, 5:21 PM
    Hi guys. I lead a popular open source Java library that's often used from Kotlin (see OptaPlanner.org). Those users are asking for nullability annotations on our public API, which we are happy to provide. However, which dependency do I add to maven/gradle to get those? I don't want java users of optaplanner that do "mvn dependency:tree" to see that optaplanner drags in android, jetbrains or findbugs jars.
    m
    j
    • 3
    • 16
  • m

    muliyul

    04/28/2020, 8:20 AM
    Hey guys I'm using javax bean validations in dropwizard and I'm getting badly formatted error messages. Anyone bumped into this or have a clue what (and if) I'm doing something wrong?
    {
      "errors": [
        "updateAddress.arg1.county must not be empty"
      ]
    }
    d
    • 2
    • 15
  • v

    v79

    04/28/2020, 7:49 PM
    I'm looking for a #serverless solution using kotlin on aws. There is #kotless, which looks good but is very young, and Osiris, which is very quiet on github. Any others?
    c
    c
    +4
    • 7
    • 10
Powered by Linen
Title
v

v79

04/28/2020, 7:49 PM
I'm looking for a #serverless solution using kotlin on aws. There is #kotless, which looks good but is very young, and Osiris, which is very quiet on github. Any others?
c

Casey Brooks

04/28/2020, 7:53 PM
I’m not too familiar with it, but you can use Java with Serverless Framework. Here’s an article in their docs using Maven, so you should be able to adapt it pretty easily to using Kotlin instead https://www.serverless.com/blog/how-to-create-a-rest-api-in-java-using-dynamodb-and-serverless/
They actually have templates for Kotlin projects too https://www.serverless.com/framework/docs/providers/aws/cli-reference/create/#available-templates
c

crummy

04/28/2020, 11:28 PM
Note that the downside to Java for serverless is the spin up time of the JVM. If your Kotlin solution is also on the JVM you'll likely also suffer this if your lambdas are rarely used.
i

ianbrandt

04/28/2020, 11:59 PM
Spring Cloud Function supports Kotlin: https://cloud.spring.io/spring-cloud-static/spring-cloud-function/3.0.6.RELEASE/reference/html/spring-cloud-function.html#_kotlin_lambda_support
v

v79

04/29/2020, 9:05 AM
Thanks all. This is a learning exercise for me, so performance isn't a major concern. I'm also keen to avoid Spring - nothing with too much magic, as I'd like to learn what's going on under the hood.
👍 2
c

Christophe Smet

04/29/2020, 12:06 PM
@v79 I think you can write kotlin serverless with https://quarkus.io/
b

Björn

04/29/2020, 5:03 PM
Micronaut also supports Kotlin https://guides.micronaut.io/creating-your-first-micronaut-app-kotlin/guide/index.html
r

Rachid

04/29/2020, 5:38 PM
If it's a learning exercise I think it would be wise to determine WHAT you want to learn. In my opinion it's inevitable to learn some AWS when you're running on that. Even if you use frameworks such as serverless or kotless you still need to have a bit of knowledge of the underlying infra. For me the best way to start learning is to use the least amount of frameworks so also no magic and do it all yourself. Concrete that would mean creating a Gradle project and using the AWS Java SDK from
com.amazonaws:aws-lambda*
which work fine in Kotlin of course. Then you could also add the Gradle plugin
jp.classmethod.aws.lambda
for easily creating an archive and deploy it directly to your AWS account
More specifics can be found here: https://sharing.luminis.eu/blog/head-first-serverless-with-aws-lambda-in-kotlin/
v

v79

05/01/2020, 6:01 AM
Thanks @Rachid, you've understood what I'm trying to do. The challenge is that there are so many things to learn all at once, so I have to pick and choose my battles. I'm still working in my day-job so this is just a side-project for me!
View count: 15