Many social media automation platforms now charge for automatically posting an RSS feed to X.com (Formerly Twitter). One alternative to paid social media automation platforms is to use Slack. If you are already paying for Slack Pro this comes at no additional cost. In this post we will have a look at setting up a Slack platform app to post our JDriven blog RSS feed to X.com.
Java 21 the new Java LTS (Long Term Support) is out and as a tribute to it I wanted to write a blog about it on the 21th day of Blogtober. What is new and which features are in it for me as a developer? I’ve taken a look at the release note from java release 18, 19, 20 and 21 and here is small summary of some new features. In this blog I only cover final released features and will exclude the features that are in preview or incubator.
Recently I stumbled upon an example of why managing your dependencies in a maintainable way is important. The issue I had was in a multi-module project where individual Maven dependencies were overridden everywhere, the result was that a lot of dependencies were in conflict and upgrading these dependencies became quite troublesome. One of the countermeasures for me was the use of certain Maven Bill of Material (BOM).
With using a BOM I only had to set version of dependencies once and did not have to duplicate the dependency in the parent because the bom implicitly has it already.
There are plenty of ways to build software that responds to changes in data or outside events. It can be less intuitive to come up with a solution that needs to respond to nothing happening.
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.
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.
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.
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.
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?
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.