https://kotlinlang.org logo
Docs
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
  • j

    jmfayard

    10/19/2019, 8:17 AM
    Kotlin is a great fit for badckend development. But the experience of searching for a job in this area? Not so nice. I put very prominently on my profiles that I do Kotlin and backend programming and that I explicitely do not want to do Android, but that’s still the vast majority of offers I’m getting. Any ideas on how do improve that experience?
    👍 4
    g
    t
    +13
    • 16
    • 82
  • s

    Steve

    10/20/2019, 6:58 PM
    I think the thing is, there's less of a need for Kotlin on the server side, because you are able to use the newer versions of Java.
    m
    p
    j
    • 4
    • 5
  • n

    Nikky

    10/21/2019, 5:25 AM
    has anyone got experience using heroku? i deployed my app there yesterday, everything worked.. now i am opening it again and my broswer
    fetch
    requests fail
    Access to fetch at '<https://pentagame.herokuapp.com/api/status>' from origin '<http://pentagame.herokuapp.com>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
    as if all the cors settings i set in Ktor had no effect anymore
    m
    • 2
    • 15
  • v

    vlad.minaev

    10/21/2019, 8:28 AM
    Hi, I'm choosing between Micronaut and Quarkus. Interested in any feedback from Kotlin support perspective.
    • 1
    • 1
  • i

    Ilya Shaydullin [IceRock]

    10/21/2019, 11:48 AM
    Hello! Use kor server core(1.2.5) I make a request for this url:
    <http://127.0.0.3/order/admin?filters%5Bid%5D=33&filters%5Baddress%5D=fooooooooo>
    When I try to get query parameters, ktor returns this: (img) How can I make it parse the
    filters
    parameter as an
    hashMap
    ? (
    val filters = hashMapOf("id" to 33, "address" to "fooooooooo")
    )
    r
    • 2
    • 2
  • j

    jaguililla

    10/21/2019, 3:05 PM
    @Nikky You can check a working example here: https://github.com/hexagonkt/todo_backend
    n
    • 2
    • 1
  • n

    Nikky

    10/21/2019, 5:06 PM
    what do other people use for dealing with databases? it seems like exposed and squash is used widely, but neither has builtin (and tested) migrations i REALLY wish sqldelight supported postgres, but i guess it does not yet.. so what is the best (least painful) alternative ?
    p
    m
    • 3
    • 11
  • j

    jaguililla

    10/27/2019, 8:25 AM
    I use TestNG. It is the most convenient to use (any public method inside a test class is considered a test without annotating it). Also back in the time it allowed me to run tests many times in each run to do simple stress tests. However I guess JUnit 5 improved a lot, although to me it is still more complicated than TestNG. For acceptance tests I use Cucumber, but you really should take a look to Spek 😉
    g
    t
    +2
    • 5
    • 15
  • v

    Vyacheslav Farionik

    11/04/2019, 11:35 AM
    Hello! I am only studying in server development. I want to create a test server with rest api for mobile applications. The server with requests and json answers wrote. I check through the postman with localhost, everything suits. The question now is how to place it on an external server or on an internal server? I found several methods in the documentation through heruku or google app engine. But for the tests it seemed a little expensive. Can it be hosted on some kind of free host or can it rent vps? I found entry-level offers within $ 3. But here is how to deploy the server there and connect to it? Should i use tomcat, netty, jetty? Help me please. I will be very grateful.
    c
    t
    +3
    • 6
    • 8
  • t

    thiagoretondar

    11/13/2019, 11:33 PM
    Hello! I want to create an webhook microservice that basically receives events from Facebook Messenger. I have some doubts about common solutions when mapping these kind of request body. The documentation says this is the kind of request that will be sent:
    {
      "object":"page",
      "entry":[
        {
          "id":"<PAGE_ID>",
          "time":1458692752478,
          "messaging":[
            {
              "sender":{ "id":"<PSID>" },
              "recipient":{ "id":"<PAGE_ID>" },
              ... // <-- this
            }
          ]
        }
      ]
    }
    where
    ...
    can be different events like
    message
    ,
    reaction
    ,
    postback
    and others. My doubt is at this part. How do you guys map those kind of JSON? The content of each property isn’t that much important for me since once it’s mapped I can send to the correct microservice the original JSON.
    f
    r
    • 3
    • 4
  • k

    Kyle Jablonski

    11/24/2019, 12:26 PM
    @here If anyone is interested in Spring + Kotlin here is a slide deck from a talk I gave last week at the NYC Kotlin meetup on the subject. https://bit.ly/35llEVx
    👍 17
    k
    s
    s
    • 4
    • 4
  • r

    rrva

    11/25/2019, 4:38 PM
    if I want to implement the bulkhead pattern in kotlin, with an old-fashioned blocking http client (OkHttp/feign), what is an idiomatic way to do it in kotlin? A channel with a coroutinecontext backed by a fixed threadpool and ThreadPoolExecutor.AbortPolicy() ?
    e
    • 2
    • 1
  • d

    Daniil Bubnov

    12/05/2019, 11:24 AM
    Hi folks, If I need to do some sql select/update operations and do not want to use
    java.sql.*
    , what kotlin lib I should choose? (preferably very simple - no orm/active record)
    a
    j
    +2
    • 5
    • 8
  • n

    nkiesel

    12/06/2019, 1:11 AM
    For JAX-RS endpoints with optional query params with default values, I currently use
    fun hello(@QueryParam("greeting") @DefaultValue("hi") greeting: String = "hi")
    to get the same default value when called via REST or directly. Is there a way to avoid duplicating the default value?
    a
    • 2
    • 1
  • p

    Pierre Thibault

    12/06/2019, 1:53 AM
    I would to respond to a post by a stream. Do you know how can do streaming with ktor?
    k
    • 2
    • 1
  • o

    Omprakash Sridharan

    12/07/2019, 5:51 PM
    Is there a good resource for learning ktor framework ?
    d
    • 2
    • 3
  • m

    Matthias R

    12/09/2019, 9:59 AM
    Hello, I am thinking of building a rest api with Ktor. Can you recommend any resources on that?
    l
    k
    t
    • 4
    • 4
  • m

    minucha

    12/12/2019, 4:13 PM
    Hi everyone, I am learning spring boot using Java not Kotlin (for now). I am stuck in serving static images. Currently, my app is serving one image with this code:
    @RequestMapping(value = "/my_image",
                method = RequestMethod.GET,
                produces = MediaType.IMAGE_PNG_VALUE)
        public ResponseEntity<byte[]> getMyImage() throws IOException {
    
            ClassPathResource imgFile = new ClassPathResource("static/images/user/my_image.png");
    
            byte[] bytes = StreamUtils.copyToByteArray(imgFile.getInputStream());
    
            return ResponseEntity
                    .ok()
                    .contentType(MediaType.IMAGE_PNG)
                    .body(bytes);
        }
    The thing is, I have 7 images, and I believe there has to be a better way than writing this method 7 times. Can someone point me in the right direction? I want generic method for serving images.
    g
    k
    • 3
    • 6
  • m

    minucha

    12/14/2019, 9:25 AM
    Hi everyone, I am using Hikari as my connection pool thing (a manager?) with MySQL database. I followed stack overflow and some other tutorials and final code is as follows : I created a
    DataSource
    class which configures Hikari
    public class DataSource {
        private static HikariConfig config = new HikariConfig();
        private static HikariDataSource ds;
    
        static {
            config.setJdbcUrl("jdbc:<mysql://username>:<mailto:password@q2gen47hi68k1yrb.chr7pe7iynqr.eu-west-1.rds.amazonaws.com|password@q2gen47hi68k1yrb.chr7pe7iynqr.eu-west-1.rds.amazonaws.com>:3306/mmylxkukgpzvjvfx");
            config.setUsername("username");
            config.setPassword("password");
            config.addDataSourceProperty("prepStmtCacheSize", "250");
            config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
            config.addDataSourceProperty("cachePrepStmts", "true");
            ds = new HikariDataSource(config);
        }
    
        private DataSource() {
        }
    
        public static Connection getConnection() throws SQLException {
            return ds.getConnection();
        }
    }
    In all tutorials I followed, they show this code or similer one but they don’t tell where and how to use the
    getConnection()
    . And the question is when, where and how do I call the
    getConnecion()
    method?
    Am I going to call it in every request I receive (in every api method defined in every single controller) ?
    @GetMapping(path = "/all")
        public @ResponseBody Iterable<ExampleEntity> getAllUsers() {
            try {
                Connection connection = DataSource.getConnection();
    // what am I gonna do with the connection ?
                return mExampleService.getAll();
            } catch (SQLException ex) {
                System.err.println("Exception Occurred");
            }
        }
    j
    f
    +3
    • 6
    • 39
  • r

    Ray Eldath

    12/17/2019, 3:07 AM
    Hi everyone. I just finish a gRPC server in C#, hesitating whether to use Kotlin for the client-side. My problem is the server-side is using proto3, but it seems that the good gRPC generator for Kotlin wire doesn't support proto3 yet (https://github.com/square/wire/issues/279). Is there any generator that can generate Kotlin-style code while handling proto3...?
    r
    j
    n
    • 4
    • 6
  • a

    amar_1995

    12/17/2019, 12:11 PM
    I am working on an android application. I want to call restful apis to my application. There are many different libraries which we can use (like, retrofit, volley, okhttp, etc) I am confused which one should I use Any suggestions ??
    r
    a
    +5
    • 8
    • 8
  • s

    shelbycohen

    12/18/2019, 1:02 AM
    Hi! Is anyone aware of a tool that can scan for possible security violations in Kotlin code similar to how Checkmarx works? Checkmarx has added Android Kotlin support but doesn’t support server side
    d
    m
    j
    • 4
    • 30
  • l

    lifey

    12/21/2019, 8:06 AM
    Hi I am trying to migrate our project (kotlin /maven) from java 8 to java 11. I fail to compile as there are some missing modules I need for compilation but I don’t know how to add them to the maven plugin definition. Can someone point me to the right direction ?
    p
    • 2
    • 1
  • a

    Ahsan Raza

    12/21/2019, 10:47 AM
    Hi, I just started backend with Ktor framework, I see documentation about ktor but there is no help about Database Connectivity and Staf like that So any Guide about Database Connection?
    t
    • 2
    • 7
  • c

    codebijan

    12/27/2019, 10:03 PM
    Anyone tried fetching firestore documents and have reference as to how to await for a pending fetch?
    x
    g
    • 3
    • 2
  • p

    Pipsy100

    12/29/2019, 9:41 AM
    Does anayone has experience with building a Ktor client in Kotlin in regard to the possibilities and limitations?
    a
    • 2
    • 1
  • c

    codebijan

    12/29/2019, 5:55 PM
    If I'm doing authentication with firebase as the provider is there a way to do it using ktor's authentication feature? How would one go about setting it up?
    l
    • 2
    • 2
  • b

    Brendan Weinstein

    01/11/2020, 9:29 PM
    There was a great tech talk I watched by a guy with an Irish accent (definitely non-american european) discussing cases were jvm apps outperformed managed memory apps thanks to runtime compiler optimizations, in the context of trading and/or financial services. Does anyone have an idea of the developer or talk I am looking for? Trying to find a link to the talk for a colleague.
    c
    f
    +2
    • 5
    • 9
  • b

    Brendan Weinstein

    01/12/2020, 2:05 AM
    What is the best library for resizing and piping images on the backend in jvm-land?
    c
    t
    +3
    • 6
    • 48
  • s

    Slackbot

    01/15/2020, 7:55 PM
    This message was deleted.
    d
    j
    +2
    • 5
    • 4
Powered by Linen
Title
s

Slackbot

01/15/2020, 7:55 PM
This message was deleted.
d

Dico

01/15/2020, 8:02 PM
This slack is for kotlin-related questions only.
j

Joshua

01/15/2020, 8:53 PM
but we are inside the server channel?
t

Tristan

01/15/2020, 9:26 PM
It's about Kotlin on server side. Your question is about Kotlin on .Net?
k

kqr

01/15/2020, 9:53 PM
why around you spaming every jvm related slacks with .net question?
🔥 4
😂 2
View count: 12