RSSAmplifier

Blog

SmartJava

Articles, books and stuff I find interesting

smartjava.orgRSS feed ↗10 posts

Latest posts

Working with nix-shell

Managing runtime dependencies using Nix We’re setting up a new project at work, and wanted to apply some lessons learned from previous projects. One of the things we ran into was that when onboarding new people, or setting up a new development environment on a different machine, the dependencies were sometimes out of sync. Usually this was quite easy to fix, but keeping all the versions in sync,…

Exploring Cats Effect

In two previous articles we explored how you can use ZIO to easily create programs in a type-safe manner: Exploring ZIO - Part I Exploring ZIO - Part II - ZStream and modules In those articles we created a simple server which polls a REST endpoint at a fixed interval, and wrote the results in a database (MongoDB). The data was then exposed through an HTTP4S REST endpoint. In that approach we used…

Exploring ZIO - Part II - ZStream and modules

In the previous article we looked at the basics of ZIO. In this part we’re going to extend on that example and add the following: ZStream integration: we’re going to create our own stream that polls an external service, and we’re going to use the reactive-stream integration to query a Mongo database. Storage layer: we’ll add persistence to the example, where everything we get from the external…

Exploring ZIO - Part I

I’ve done a lot of Kotlin for the last two years, and have mainly followed Scala and done some pet projects. Since a lot of interesting stuff has been going on in the Scala space for the last couple of months, I want to start writing some more about it, and my experiences with it. So expect some articles on Scala 3 and ZIO. For the first of these set of articles, I’d like to focus a bit on ZIO.…

Running a minimal Kafka instance on K8S

A couple of days ago I ran into an issue with our hosted Kafka environment, and we had to give a demo. So I was looking for a quick way to run a simple ephemeral Kafka instance on our kubernetes cluster. I looked around a bit, and couldn’t find one working out of the box, so I adapted one I found and which almost worked…

My 10 goto terminal commands

There are a lot of useful terminal/shell commands which can make your live a lot easier. I do a lot of backend development, and there is a set of commands which I use a lot during development, testing or operations work. So maybe this list can introduce you to a command that can make your live a little bit easier. jq jq is a command which can be used to parse and transform json. I use it a lot in…

Standalone Apollo Graphql Websocket Subscriptions

This is just a quick article on how to create a simple standalone Apollo client to test Graphql subscriptions. I needed something like this when we ran into some strange issues at work, where our Graphql backend (Kotlin) and Apollo React frontend stopped working, or got into a refresh loop. To easily test this I wanted something I could script to easily run a couple of scenarios without having to…

Getting started with Rust - part 2

In the previous article I started experimenting with Rust and build a very simple extension to git, which helps me remember the most recent branches I’ve been working on, or did PRs for. For this second article, I wanted to do look at how you can do network programming in Rust. (If you just want to skip to the code: https://github.com/josdirksen/dns-proxy-rusts) For this, and the next article,…

Getting started with Rust - part 1

I decided to look a bit into Rust. I’ve been hearing great things about it, the community seems to be (mostly) very inviting and open, and the language in itself seems to have a nice mix of modern features (lambdas, boxed types, extensions), while still allowing for low-level systems programming. The initial idea was to work through the The rust programming languagebook and write a bit about that.…

Setting up a simple Kafka cluster with docker for testing

In this short article we’ll have a quick look at how to set up a Kafka cluster locally, which can be easily accessed from outside of the docker container. The reason for this article is that most of the example you can find either provide a single Kafka instance, or provide a way to set up a Kafka cluster, whose hosts can only be accessed from within the docker container. I ran into this issue…