Skip to main content

Blog

Technical writing about Kotlin, backend engineering, and software architecture. Posts are being migrated – check kotlinbackend.com for existing content.

How to inject multiple implementations in the Spring Framework

Recently, I had a discussion with one of my colleagues during a code review. We talked about a hidden gem in Spring (as well as other frameworks like Micronaut) that could simplify our code.

Let’s consider a task: developing a good morning greeting system that supports both English and Hebrew languages. The system should greet us in each of these languages.

We’ll begin with the native implementation by introducing our greeters:

4 Reasons Why Amazon Keyspaces is Problematic!

Around a year ago, my team and I were tasked with building a high-performance system capable of handling a large volume of requests. After careful consideration, we chose Cassandra as our database.

When it came to productizing our system, we explored three main options:

  • Self-hosted Cassandra: We ruled this out due to the need for hardware maintenance.

  • DataStax: Dubbed the “Confluence-Kafka” of Cassandra, it offers a fully cloud-based implementation managed by the DataStax team.

Build your own Twitter Bot with Kotlin

I read an excellent article by Martin Erlic called “How To Make a Scary Russian Twitter Bot With Java” and I wanted to update it using Kotlin.

Unlike the original article, I will use Kotlin, a newer and more modern JVM-based language, and Gradle as the build system.

To build the bot, follow these simple steps:

Step 1 — Create a Twitter Application

The first step is to create a Twitter Application using the user account you want to perform the API requests with. By creating the Twitter application, you will obtain the API key and API secret, which we’ll later use to authenticate our bot with Twitter.