If you are new in kotlin or JVM based system and want to know how to get free memory total memory and max memory from the runtime class here s I have shared some example to answer some beginners quest
An example Kotlin code snippet to show you how to get the number of available processors cores CPUs in your environment Get Available CPU s in Kotlin Runtime getRuntime availableProcessors You can als
In Spring webflux tests I was having this timeout out issue and I wanted to increase timeout in the webclient Exception java lang IllegalStateException Timeout on blocking read for 500 MILLISECONDS a
I wanted to read an entire json file which contains my test request I found this very quick and super simple 1 line to read an entire file as string Quickest Solution File path my test json readText S
Super simple trick to get the path of of your project folder in kotlin You can also use this example snippet for your java or spring project as well Example location of your main file Users my user co
If you want to define a top level logger and access it from functions in the same file Here s how you can achieve this You can use this when you need A static logger without specifying the class name
Making requests become super easy in favor of okhttp3 This example implementation would help you to understand and create your own http client in kotlin and send requests Dependencies Let s start with
If you are looking for reading and accessing request headers from your spring boot kotlin application, here are some example implementation that you can follow. Reading Header in Kotlin From Spring Http Request To read headers you can use @RequestHe
If you need an all in one Jar (Fat Jar) in Gradle with the Kotlin DSL syntax, Here is an example of how you can build a shadow jar for both java and kotlin application. Difference between Java vs Kotlin App If you are building kotlin spring-boot app
Creating and validating signature is commonly use to verify the authenticity of a request. Heres a tiny kotlin function to generate HMAC signature from string data. Using the signature generator val signature = createSignature("myStringData", "mySec
Today I've spent too much time writing a middleware in kotlin for spring webflux to log my request. As I am super new, It was pretty difficult to understand some of the complex examples on few tutorial found online. So I wanted to share the basic tem
Recent comments on kotlin
I repeatedly get a java.io.FileNotFoundException No such file or directory The .json