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
  • b

    Ben

    02/21/2019, 2:21 PM
    Hi guys! I'm currently working on a REST application and try to do that with spring boot, webflux and the functional way with kotlin. With Annotations one could write unit tests by mocking the repository and call the methods of the controller. As the controller returns a Mono of the desired object, it was easily compared and asserted. In the functional way, my handler returns a Mono<ServerResponse>. When I debug it, the desired object is in that ServerResponse, but how to I get it's body? The interface doesn't offer a method for that?! Any help is appreciated! 🙂
    t
    l
    s
    • 4
    • 8
  • s

    Slackbot

    02/21/2019, 3:51 PM
    This message was deleted.
    d
    • 2
    • 1
  • б

    Бежан Александр

    02/21/2019, 7:31 PM
    Hi everyone, i have a problem, i am using code from sources but Ktor returns me not json of data class but just "null" any suggestions ? THX) http://prntscr.com/mobkfz
    b
    s
    • 3
    • 13
  • t

    thiagoretondar

    02/22/2019, 8:20 PM
    Do you think #spring can be overtaken by #micronaut? Which one you think is better to work with Kotlin?
    a
    l
    +3
    • 6
    • 22
  • c

    Charlie

    02/22/2019, 9:53 PM
    Anyone familiar with using the Kotlin Jackson module to parse out a JSON object with nested objects? For the nested objects it seems to only work in cases where the JSON matches exactly (@JsonIgnoreProperties and configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) do not help, though it works with the top level object). The failure is MismatchedInputException: Cannot construct instance, which I guess makes sense due to data class constructors, but is there some way to make this more flexible? Only parse the fields I need, and not break if the API returns a subset of the fields, or a new field? I'm a Kotlin newbie so just trying to figure this out as I go and any help would be appreciated.
    a
    m
    +3
    • 6
    • 54
  • r

    rrva

    02/28/2019, 4:19 PM
    Want to advertise a light-weight server microframework for HTTP services we've been using in production for over a year: Jooby. 1.x has been around for many years and to my mind has a great balance between noninvasiveness (you can easily move off jooby as a framework should you decide to do so), productivity and lightness, but still with great basic feature set. It also has a nice Kotlin DSL for HTTP routes. Tastefully built in my opinion, and you go for a more annotation/injection free style of programming for microservices where application logic code can be given a greater focus because the rest "never gets in the way". Good set of plugins for common use cases. Now 2.x is under development, and a notable feature is Kotlin coroutine support 1.x: https://jooby.org/ (We've been using it for over a year in production) 2.x: https://jooby.io/ (Now with Kotlin coroutines)
    ❤️ 1
    👎 2
    👍 2
    🚓 5
    👏🏾 1
    d
    i
    n
    • 4
    • 5
  • a

    Artem Bakuta

    03/04/2019, 8:50 PM
    Hi every one, may be somebody can help me? https://github.com/Kotlin/kotlinx.coroutines/issues/1026 here is my issue. I think trouble that I’m using 1.3.21 kotlin and something wrong with corrutines
    d
    • 2
    • 3
  • r

    Rick Prata

    03/10/2019, 4:55 AM
    I'm struggling to understand how I can make my ktor server communicate with another server. Maybe because that's a new concept to me since I'm an android developer but as far as I was able to understand I would need to have a reverse proxy component. What I'm trying to do is to have periodic data fetching of another server from ktor so when my client need I will have a lot of data available that was fetched in advance. Like a workmanager on android Could anyone give me a direction and tell me where I should be looking at?
    g
    m
    • 3
    • 14
  • m

    mbonnin

    03/18/2019, 11:47 AM
    Hi Everyone, I'm fairly new to the backend and I'm looking for an easy way to build a json API. Is there a framework that would allow me to describe my API using some kind of description language and generate some code for me ? (I'm thinking at least serialization/deserialization, parameter checking and documentation generation, maybe also access rules). All the things I have seen so far are still pretty low level and require me to do the error prone json serialization/deserialization, etc...
    s
    d
    d
    • 4
    • 18
  • d

    davidups

    03/19/2019, 2:42 PM
    Someone have a repository of Ktor with Database¿?
    e
    • 2
    • 6
  • c

    Colton Hurst

    03/19/2019, 7:04 PM
    Hi all, just started learning Kotlin! I'm a backend developer who is looking to use Kotlin in the backend, specifically for building apis. Out of curiosity, what companies use Kotlin on the backend? Is there a list out there? Most lists I see are for Android dev (which make sense).
    j
    c
    d
    • 4
    • 3
  • a

    asad.awadia

    03/20/2019, 3:03 AM
    If i have a simple rest api on a server - whats the best way to test how many requests per seconds it can do? I am trying to load test it via bench/vegeta/jmeter etc but my client machine runs out of resources i think before i reach the peak
    x
    s
    +2
    • 5
    • 32
  • d

    Dennis Schröder

    03/21/2019, 9:15 PM
    Is there a email library, preferably lightweight, that anybody can recommend to use with ktor?
    j
    • 2
    • 2
  • m

    mp

    03/21/2019, 9:21 PM
    define “email library”
    d
    r
    • 3
    • 3
  • a

    andrea.santurbano

    03/26/2019, 12:44 PM
    Hi everyone I'm working with Kafka via Kotlin and we want to transform its
    Future
    implementation (https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/internals/FutureRecordMetadata.java) as
    Deferred
    . Could this be a solution?
    fun <T> Future<T>.asDeferred(dispatcher: CoroutineDispatcher = Dispatchers.Default): Deferred<T> {
        return GlobalScope.async(dispatcher) {
            get()
        }
    }
    r
    b
    • 3
    • 26
  • s

    Slackbot

    03/26/2019, 4:11 PM
    This message was deleted.
    l
    • 2
    • 1
  • v

    Velastroll

    04/01/2019, 12:31 PM
    Hey guys! I'm developing a webapp and its working in local on many computers, but when i deploy on remote, the request are pending and not change it. The remote server is TomCat and it's behind a reverse proxy. Anyone know what could be the problem?
    d
    • 2
    • 8
  • t

    thiagoretondar

    04/05/2019, 1:30 PM
    Hey guys! I want to develop a system where is possible to “translate” a JSON in another via a web interface. The point of this is give users ability to create those parsers without the programming language. Today I already have this written in NodeJS and using Handlebars (HTML template engine for building JSON sucks 🤮). I’m rewriting some microservices in Kotlin (with #spring) and I’d like your opinion about this system be written in Kotlin? Any suggestion how could I do this?
    j
    r
    • 3
    • 4
  • b

    bbaldino

    04/08/2019, 7:53 PM
    is there anyone who's familiar with security stuff (dtls handshake, in particular) ideally with bouncycastle but any JCA knowledge would be helpful? i'm trying to navigate all these classes and getting lost amidst everything and could really use some guidance. i get this isn't exactly kotlin-specific but i'm getting desperate.
    m
    • 2
    • 4
  • s

    Stephan Schroeder

    04/09/2019, 2:50 PM
    Hey devs, so I got a problem with creating a fat jar in my project since we I converted the Gradle config from GroovyDSL to KotlinDSL. We used to use the shadowJar plugin, but according to what I googled so far, there should even be a solution without it. So I converted (with the help of Stackoverflow) the Groovy solution (of how to configure the jar-plugin). But
    gradle clean build
    still doesn't create a fat jar (but at least the main-class is set). Here is the Stackoverflow ticket: https://stackoverflow.com/questions/55575264/creating-a-fat-jar-in-gradle-with-kotlindsl
    m
    n
    d
    • 4
    • 9
  • n

    Nezteb

    04/15/2019, 7:26 PM
    Does anyone use a Kotlin server lib/framework that supports auto-generation of Swagger YAML files? For example, most JAX-RS libraries support it via `swagger-core`: https://swagger.io/tools/open-source/open-source-integrations/
    t
    d
    • 3
    • 3
  • a

    Adi Polak

    04/17/2019, 12:57 PM
    Kotlin coroutines, are they better than threads when developing server side ? are they a better than Java thread pool ?
    r
    s
    s
    • 4
    • 6
  • t

    thiagoretondar

    04/20/2019, 7:26 PM
    hey all, How do you name your DTOs? For example I have a
    entity
    called
    Alert
    and for CRUD operations I have a DTO to create, so I’m naming
    AlertCreationDTO
    but to update I can’t use
    AlertCreationDTO
    because some fields can’t be updated. So how you organize/name those DTOs?
    j
    t
    i
    • 4
    • 3
  • n

    Nezteb

    04/24/2019, 3:46 PM
    With regard to Swagger: https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started#what-is-it-about
    swagger-core
    has a
    swagger-models
    module that includes all the various bits of a Swagger file as code. Microsoft has https://github.com/Microsoft/OpenAPI.NET for C#, with documentation on how to write a swagger doc with code instead of json/yaml by hand. Is anyone aware of how to do that with
    swagger-models
    or a library similar to it?
    t
    • 2
    • 1
  • s

    Stefan Peterson

    04/24/2019, 11:52 PM
    Has anyone used resilience4j with a kotlin project before? Looking to use it as a circuit breaker for all communication with external services. Mostly just want to know if you felt it was a reliable tool and easy to work with or if there was some alternative that you found to be better. https://github.com/resilience4j/resilience4j
    d
    d
    • 3
    • 2
  • e

    Eduardo Pinto

    04/25/2019, 9:45 AM
    Hello. I'm in doubt about on bevahior from all method on Collections:
    /**
     * Returns `true` if all elements match the given [predicate].
     * 
     * @sample samples.collections.Collections.Aggregates.all
     */
    public inline fun <T> Iterable<T>.all(predicate: (T) -> Boolean): Boolean {
        if (this is Collection && isEmpty()) return true
        for (element in this) if (!predicate(element)) return false
        return true
    }
    Does this condition:
    if (this is Collection && isEmpty()) return true
    makes sense? Should return true for applying a predicate to an empty collection? Example:
    val s = emptyList<String>()
    if (s.all { it.isNotEmpty() }) {
        // should  the code  enter here?
    }
    g
    m
    +2
    • 5
    • 8
  • n

    napperley

    04/26/2019, 2:55 AM
    Is there a way to get Jetty to be far less verbose with its logging?
    t
    • 2
    • 5
  • a

    Andreas Du Rietz

    05/10/2019, 6:18 AM
    Good morning! I’m looking into kotlin as a server side language (api’s & workers). What frameworks are recommended? We’re not a fan of spring’s approach on java with loads of annotations and magic. Prefer the style of akka-http or playframework on scala if anyone is familiar with them.
    f
    d
    +3
    • 6
    • 12
  • a

    Andreas Du Rietz

    05/10/2019, 7:40 AM
    Another question thats probably impossible to answer. Number of developers. Seems like kotlin has had tremendous success in recent years but i’m guessing most of it comes from android developers moving from java? What about on the server side, is there any data? What companies has moved to use kotlin as their main weapon of choice on the server?
    s
    h
    +8
    • 11
    • 14
  • p

    paulex

    05/16/2019, 11:04 PM
    KotlinEverywhere!!!
    s
    h
    • 3
    • 2
Powered by Linen
Title
p

paulex

05/16/2019, 11:04 PM
KotlinEverywhere!!!
s

Sergey Bondari

05/17/2019, 2:00 AM
Amen, bro!
h

hallvard

05/17/2019, 1:12 PM
Except in the hiney
View count: 2