Amazon Web Services offers a way to connect to a MySQL or PostgreSQL database without having a password, instead an authentication token can be used.
Within AWS this type of authentication is called RDS IAM.
Users don’t need to store an username and password and credentials don’t need to be stored in the database, which makes this a secure authentication method.
So, this makes it interesting to use this in your Spring Boot application.
Spring Boot will use a HikariCP connection pool by default, but HikariCP 4.0.3 doesn’t support the use of authentication tokens.
So, how do I make this work within my Spring Boot application?
-
Enable RDS IAM for your database
-
Create a custom Hikari DataSource
-
Update application properties
Continue reading →
Robot Framework is easy enough to set up.
When you have Python installed on your system, it can be as easy as running pip install robotframework &&
pip install robotframework-appiumlibrary.
This is not how I want to do it.
For this intro, I want to run the Robot Framework in a Docker image.
Robot Framework is a generic open source automation framework.
It can be used for robotic process automation (RPA), and also for acceptance level testing and acceptance test-driven development (ATDD).
In this blog I want to focus on the first steps to start working with it.
Continue reading →
Apache Kafka is often used together with Confluent Schema Registry, as the schema registry allows you to store and retrieve your Avro, JSON Schema and Protobuf schemas for Kafka message (de)serialization.
By storing a versioned history of schemas for topic values, with configurable enforced compatibility,
you ensure producers and consumers can continue to exchange compact serialized messages even as schemas evolve.
By default, client applications automatically register new schemas.
If they produce new messages to a new topic, then they will automatically try to register new schemas.
This is very convenient in development environments, but in production environments we recommend that client applications do not automatically register new schemas.
Best practice is to register schemas outside of the client application to control when schemas are registered with Schema Registry and how they evolve.
— On-Premises Schema Registry Tutorial
On Auto Schema Registration
Continue reading →
How would you like to use your favorite backend language to develop frontend?
In this blogpost I’ll show you how to compile a small kotlin example to WebAssembly and how to run the output in your browser.
Continue reading →
Struggling with merging multiple repositories together into one (mono) repository?
You wanna preserve your valuable git history?
This blogpost will show you how to do this step-by-step.
Continue reading →
If we have an Optional instance we can consume the value if it is present using the ifPresent method. Since Java 9 the method ifPresentOrElse has been added to the Optional class. The first argument is of type Consumer and is invoked when there is an optional value. The second argument is of type Runnable and is executed when the the optional is empty. The method in the Consumer and Runnable implementations does not return a type but returns void. Therefore we should use ifPresentOrElse when we need a conditional side effect for an Optional instance.
In the following example we have a method handleName that will update a list if an optional value is present or increases a counter when the optional value is empty:
Continue reading →
In the clojure.set namespace we can find the function map-invert. This function returns a new map where the values are keys with the appropriates keys of the original map assigned as value. If the original map has duplicate values than the latest key for the duplicate value will be the value of the new key.
In the following example code we see the result of using map-invert:
Continue reading →
A Spring Boot application typically consists of several components handling the business functionality and probably some configuration to configure all these components.
This configuration consists of defining some properties, setting up some beans with the right conditions and dependencies and wrapping it all together into a class structure.
Nevertheless, the configuration of our Spring Boot application is also code.
Let’s threat is as code.
In this blog we will se how we can improve our Spring Boot Configuration by splitting up the configuration from the properties and how this effects the design principles.
Continue reading →
Outside the Java community, Java is often regarded as an old and verbose language. Though I love writing Java code, I kind of have to agree with this. New features are implemented slowly and looked upon by the language designers with thorough suspicion. For example, support for multi-line strings has been tried multiple times before Java got official support. If we are talking about verbosity, the Java language needs quite some characters to write a simple function. As I am specializing in functional programming in Java this year, I struggled a lot with this. Read along how I tackled this a little.
Continue reading →
If we want to get two types of information from a Stream of objects we can consume the Stream twice and collect the results. But that is not very efficient, especially when the stream has a lot of objects. Since Java 12 we can use the teeing method of the java.util.stream.Collectors class to get multiple results while consuming the stream of objects only once. The teeing method takes two collectors as argument each returning a separate result for the stream items. As third argument we must pass a function that will merge the results of the two collectors into a new object.
In the following code we have two example use cases that use the teeing method to get multiple results while consuming a Stream of objects only one time:
Continue reading →