jq
is a powerful tool to work with JSON from the command-line. The tool has a lot of functions and operators that makes our live easier. One of the operators we can use is the alternative operator //
which allows us to specify default values. If the value on the left side of the operator //
is empty, null or false then the value on the right side is returned, otherwise the value itself is returned. The operator can be used multiple times if we want to have multiple fallbacks for a value we are checking.
Continue reading →
With simple ZIO layer creation, it’s convenient to use +`, `>>>` and `>>
to compose layers.
When layers and dependencies get more complex, ZLayer.make is there to help.
Continue reading →
We were promised that microservices would make our software more stable and easier to scale horizontally. But the added complexity often creates a lot of shared code and complex infrastructure.
Dapr promises a solution by placing these cross-cutting concerns outside your code.
Continue reading →
Kotlin’s standard library offers many functions, but the ones that stand out in my opinion are scope functions. These scope functions
exist to execute a code block in the context of the object on which you execute it. Within this scope, you can perform operations on the object with or without a name. Scope functions can make code more readable and concise, but beware! Nesting scope functions can cause confusion about the current context object.
Continue reading →
When using mutual TLS (mTLS), the client authenticates the server by checking whether the server’s certificate is signed with a trusted CA certificate, i.e. a certificate that exists in its trust store.
And vice versa, the server authenticates the client by checking the client’s certificate against its truststore.
Both authentications are done at TLS level.
Mutual TLS thus requires truststores and keystores on both the client and server side.
One-way TLS only requires a keystore on the server side, and a truststore on the client side.
So one-way TLS requires a simpler client setup, because it does not need a client specific keystore.
But how does authentication work with own-way TLS. Specifically, how does one protect againts a man-in-the-middle attack?
Continue reading →
In Groovy we can apply the @NullCheck
annotation to a class, constructor or method. The annotation is an AST (Abstract Syntax Tree) transformation and will insert code that checks for null values in methods or constructors. If a null
value is passed to an annotated method or constructor, it will throw an IllegalArgumentException
. Without the annotation we could have a NullPointerException
if we try to invoke a method on the value we pass as argument. The annotation has an optional property includeGenerated
which by default is false
. If we set it to true
then the null checks are also applied to generated methods and constructors. This is very useful if we apply other AST transformations to our class that generates additional code.
Continue reading →
You never touched Groovy, nor did you jump on the Scala train.
Clojure never attracted you; and you heard about Ceylon long after the language had already died.
You are one of those old-fashioned Java folks!
But now, after all those years, you want to join the cool Kotlin kids.
So, where to start?
Let’s discover the language together by decompiling it to Java code.
Today: Inline functions caveats!
Continue reading →
Within software engineering, innovation is the name of the game.
Like I discussed in my previous blog post, we are continually searching for ways to optimize work, boost productivity, and deliver value to users more efficiently.
As we explore prompt engineering in the context of software development, a crucial question arises: Is it a complementary tool enhancing our software engineering arsenal, or does it pose a fundamental challenge to traditional software engineering practices?
Continue reading →
It were 2 intensive days full of collaboration with people inspired by Domain Driven Design and Event Driven systems. Please, read on for my key takeaways.
Continue reading →
The Gradle Java plugin extends the Base plugin and provides the tasks needed to build a Java (or Kotlin) project.
They resemble the Maven build phases for those familiar with Maven.
See also Migrating Builds From Apache Maven - Understanding the build lifecycle
However, the output from Gradle generally is very different than that of Maven, usually more concise.
This is not always what you want.
Below you will find some nice commands, options, and configurations that can make the output to the console more complete (a bit more like Maven).
This can be particularly helpful when building in a pipeline (eg. GitLab, GitHub, etc.), in which case log files and build reports are usually less or not available.
Most of the time all you have is the output to standard out, in which case you would like it to be as complete as possible, specially when the build fails.
Continue reading →