Posts
Quarkus Form Authentication using JDBC
While experimenting with Quarkus and its amazing Quinoa extension, I wanted to add form authentication to my project. Quarkus offers a
BcryptUtil
utility class for hashing and verifying passwords. It also provides two database authentication extensions. One for JPA and one using plain JDBC. Since I wanted to use jOOQ for persistence, the JPA extension would add unnecessary dependencies to my project so JDBC was the clear choice. Unfortunately the JDBC extension doesn’t play along with the hashing utility which expects passwords to be in the Modular Crypt Format (MCF). That’s why I decided to do some research and implement the authentication code myself using the built-in hashing utility.Starting External Processes from Vert.x
Sometimes it’s necessary to run a script or command line application from your JVM applications. In my case, I wanted to generate my thumbnails using the ImageMagick CLI tools. Luckily the
convert
utility has support for reading images from standard input and writing the thumbnails to standard output.Streaming Zip Archives to the Browser using Vert.x & Coroutines
When we want to serve users multiple files as a download, a common way is to combine those files into an archive. The JDK provides the
ZipOutputStream
to build ZIP archives. Unfortunately this is based on blocking IO so using it with Vert.x can be a bit cumbersome. It becomes even trickier if you want to skip storing the archive on the file system temporarily. Let’s see how we can make things easier using Kotlin’s coroutines.Idiomatic Kotlin Abstractions for the Vert.x EventBus
The EventBus plays an important role in Vert.x applications. It is a convenient way for modules to communicate with each other using various messaging patterns.
Writing Vert.x Integration Tests with Kotlin & Testcontainers
Testcontainers are widespread in integration testing where mocking external services such as databases may not be desirable. In this article, we will explore how to use Testcontainers in our Verticle tests.
Reducing Boilerplate in Vert.x Tests written in Kotlin
In the previous part, we saw how Kotlin can reduce noise in asynchronous tests. In this part we will introduce some syntactic sugar that will help us avoid repetition in our Verticle tests.
Writing Async Tests for Vert.x using Kotlin
Testing asynchronous code can be a challenging task. Usually some tooling is required to make it work with testing frameworks like junit.