Skip to main content

Kotlin

Kotlin Extensions for LangChain4j

Discover Kotlin extensions for LangChain4j designed to transform the synchronous LangChain4j API into a modern, non-blocking experience with Kotlin Coroutines. Learn about key features including coroutine support for ChatLanguageModels, Kotlin Flow for streaming responses, external customizable prompt templates, and non-blocking document processing. Enhance your Kotlin programming skills and improve application efficiency by leveraging these powerful new tools.

Running Testcontainers On Dynamic Ports

Running integration tests locally with Docker can be challenging when fixed ports are unavailable due to conflicts. This issue is compounded in shared CI environments where multiple workers are in use. However, using testcontainers can help overcome these obstacles by enabling the startup of Docker containers that listen on random ports.

Kotlin Playground Shortcode for Hugo

Kotlin Playground is HTML component which creates Kotlin-aware editors capable of running code from HTML block elements. Here I explain how to embed runnable Kotlin code block in your Hugo-powered blog.

Building Data Pipeline with Kotlin Coroutines Actors

This blog post demonstrates how to build a data processing pipeline using Kotlin coroutines and actors, showing both single-threaded and parallel implementations. It walks through creating a simple data pipeline using Kotlin’s channel and actor abstractions for clean concurrent programming. The post includes practical code examples of handling message passing between actors, managing thread pools, implementing back-pressure, and scaling from a basic sequential pipeline to a parallel version that processes data more efficiently. The explanation is backed by detailed logging output that illustrates how messages flow through the system and how parallel processing improves overall performance.

Customizing REST API Error Response in Spring Boot / Spring-Security-OAuth2

Defining error format is important part of REST API design.

Spring-Boot and Spring Security provide pretty nice error handling for RESTful APIs out of the box. Although it has to be documented, especially when contract-first approach to API design is used.

It is good idea to follow some common format for error responses. But OAuth2 specification and Spring Boot format may not satisfy those requirements.