Kotlin - tail recursion optimization
Kotlin compiler optimizes tail recursive calls with a few catches. Consider a rank function to search for the index of an element in a sorted array, implemented the following way using tail recursion...
View ArticleKotlin - Try type for functional exception handling
Scala has a Try type to functionally handle exceptions. I could get my head around using this type using the excellent Neophyte's guide to Scala by Daniel Westheide. This post will replicate this type...
View ArticleKotlin - Tuple type
It is very simple to write a Tuple type with the expressiveness of Kotlin. My objective expressed in tests is the following:1. Be able to define a Tuple of up to 5 elements and be able to retrieve the...
View ArticleSpring Based Application - Migrating to Junit 5
This is a quick write-up on migrating a Gradle based Spring Boot app from Junit 4 to the shiny new Junit 5. Junit 4 tests continue to work with Junit 5 Test Engine abstraction which provides support...
View ArticleKotlin - Reified type parameters sample
This post walks through a sample that demonstrates Kotlin's ability to cleverly reify generic type parameters. So consider first a world where Kotlin does not support this feature, if we were using the...
View ArticleSpring Boot 2 Applications and OAuth 2 - Setting up an Authorization Server
This will be a 3 post series exploring ways to enable SSO with an OAuth2 provider for Spring Boot 2 based applications. I will cover the following in these posts:1. Ways to bootstrap an OpenID Connect...
View ArticleSpring Boot 2 Applications and OAuth 2 - Legacy Approach
This post is the second part of a 3 post series exploring ways to enable SSO with an OAuth2 provider for Spring Boot 2 based applications. The 3 posts are:1. Ways to bootstrap an OpenID Connect...
View ArticleSpring Boot 2 native approach to SSO with OAuth 2/OpenID Connect
This post is the final part of a 3 post series exploring ways to enable SSO with an OAuth2 provider for Spring Boot 2 based applications. The 3 posts are:1. Ways to bootstrap an OpenID Connect...
View ArticleKotlin and JUnit 5 @BeforeAll
IntroductionIn Kotlin, classes do not have static methods. A Java equivalent semantic can be provided using the concept of a companion object though. This post will go into details of what it takes to...
View ArticleSpring Cloud Gateway - Configuring a simple route
Spring Cloud Gateway can be considered a successor to the Spring Cloud Netflix Zuul project and helps in implementing a Gateway pattern in a microservices environment. It is built on top of Spring Boot...
View ArticleTestContainers and Spring Boot
TestContainers is just awesome! It provides a very convenient way to start up and CLEANLY tear down docker containers in JUnit tests. This feature is very useful for integration testing of applications...
View ArticleZuul 2 - Sample filter
Zuul 2 has finally been open sourced. I first heard of Zuul 2 during Spring One 2016 talk by Mikey Cohen is available here, it is good to finally be able to play with it.To quickly touch on the purpose...
View ArticleTracing a reactive flow - Using Spring Cloud Sleuth with Boot 2
Spring Cloud Sleuth which adds Spring instrumentation support on top of OpenZipkin Brave makes distributed tracing trivially simple for Spring Boot applications. This is a quick write up on what it...
View ArticleJib - Building docker image for a Spring Boot App
I was pleasantly surprised by how easy it was to create a docker image for a sample Spring Boot application using Jib. Let me first contrast Jib with an approach that I was using before. I was creating...
View Article"Knative Serving" for Spring Boot Applications
I got a chance to try Knative'sServing feature to deploy a Spring Boot application and this post is simply documenting a sample and the approach I took.I don't understand the internals of Knative...
View ArticleKnative Serving - Service to Service call
In a previous post I had covered using Knative'sServing feature to run a sample Java Application. This post will be go into the steps to deploy two applications, with one application calling the...
View ArticleKnative serving - using Ambassador gateway
This is a continuation of my experimentation with Knative serving, this time around building a gateway on top of a Knative serving applications. This builds on two of my previous posts - on using...
View ArticleHelm chart to deploy and scale a generic app image
This is a post about a simple helm chart that I have worked on to deploy any generic app image to Kubernetes. The chart is available here(https://github.com/bijukunjummen/generic-app-chart).It tries to...
View ArticleReactive Spring Webflux with AWS DynamoDB
AWS has released AWS SDK for Java version 2, the SDK now supports non-blocking IO for the API calls of different AWS services. In this post I will be exploring using the DynamoDB API's of the AWS SDK...
View ArticleUnit testing DynamoDB applications using JUnit5
In a previous post I had described the new AWS SDK for Java 2 which provides non-blocking IO support for Java clients calling different AWS services. In this post I will go over an approach that I have...
View Article