Archive: 2019

Distributed Tracing with Kafka Streams

Posted on by  
Tim te Beek

Distributed tracing is a method used to profile and monitor applications, especially those built using a microservices architecture. Distributed tracing helps pinpoint where failures occur and what causes poor performance.[1] Applied to Kafka Streams it allows us to trace and visualize our messages by propagating diagnostic information within message headers.

Continue reading →

Don't pass null to a function

Posted on by  
Ties van de Ven

I have seen the following pattern appear quite a lot:

private String foo(String bar) {
  if(bar != null){
    return "bar";
  }
  return null;
}

Here the function is called with a nullable argument, and if the argument was null, the function will return null, and if not it will return a proper value. I do not like this, and here is why.

Continue reading →

Converting Char to Int in Kotlin

Posted on by  
Riccardo Lippolis

The Kotlin standard library contains a lot of helper functions on top of the Java standard library for our convenience. Some of those functions help us in converting between different data types. For example, the String.toInt() function converts a number formatted as String to its Int representation. But how do we accomplish the same with a Char? Spoiler alert: NOT by using Char.toInt(), but by using Char.digitToInt()!

Continue reading →

Kotlin method reference to companion object function

Posted on by  
Riccardo Lippolis

Functions defined in Kotlin companion objects are often seen as the 'equivalent' of static methods in Java. Although there are some similarities, there are also some caveats you should be aware of. For example, how to use method references (or, to be pedantic: function references) to refer to functions defined in a companion object.

Continue reading →

Customising form validation in Javalin using Valiktor

Posted on by  
Justus Brugman

Since about a month I’m developing some microservices using Javalin, a small, simple and lightweight web-framework that started as a fork from SparkJava. By now it’s a ground-up rewrite, influenced by the Javascript framework koa.js. Don’t let the stuff like Either scare you, we use the Arrow library to make our life a bit more easy :)

When requesting user input from a form, it’s evident that we need to validate our input. Javalin has its own way of doing so (from the docs):

Continue reading →

Java streams vs for loop

Posted on by  
Ties van de Ven

Java streams vs for loop

I had quite a bit of trouble finding a good article about java streams vs for loops under this name so I guess I’ll have to write it myself. In this article I would like to talk about the difference of using the Streaming API and for loops from the standpoint of long term maintainability of the code.

tl;dr: To reduce maintenance costs of your projects, please do consider using the Stream API instead of for loops. It might take some investment in learning to do so, but this investment will pay off in the long run, both for the project and for the engineers.

Continue reading →

Slicing Kibana logs with Vue.js

Posted on by  
Tim te Beek

Nowadays we frequently see companies adopting the Elastic Stack to search, analyze and visualize application data in real time. While the scope of application data ingested these days is broadening, it’s already quite common to monitor aggregated application logs in Kibana. Because of this, I frequently find myself coming back to Kibana to slice and filter the logs to monitor how our application deployments progress through deployments. In this blogpost, I’ll outline a small Vue.js web application I wrote to more easily access our application logs.

Continue reading →

Cultivating technical innovation in daily operation

Posted on by  
Jasper Bogers

Many companies that are undergoing a digital transformation are discovering that it is an endless endeavour. Technological innovation allows a company to become more responsive to change in their business domain, but also makes it subjective to progress in the underlying technical implementation. A lot can be said for the delivery pipeline optimizations that help deliver business value more efficiently, but how does your organisation keep up with technological innovation?

Continue reading →

shadow-left