Posts from the past, in chronological order

Posts —— 11…20 of 42
Protecting endpoints with Spring Security Resource Server
OAuth2 is the industry standard for providing authorization. Spring Security provides an OAuth2 Resource Server starter to implement an authorization layer. Learn how to implement a service-to-service authorization flow using client-credentials grant type and audience claim.
Cleaning up Docker resources
In good old days, we used to write scripts to cleanup stale Docker containers, images, volumes, etc. Docker Engine 1.25 provided a relatively straightforward way to cleanup unused resources using the prune command.
Retrying on failure with Resilience4J and Aspects
Failure is an inevitability in a complex distributed system. A service may time out, a filesystem may run out of space or an API endpoint may be unavailable because of a failed deployment. If we know that a failure lasts only for a short time, we may attempt to recover from it by using a retry pattern.
Logging methods with AspectJ in a Spring application
Method logging is a common pattern to collect data about a method. This could be execution time, the inputs and outputs of the method, etc. You can do this by using a logger but since this is a repetitive task, we'll look at how to automate it.
API Documentation with Springfox 3
Springfox v3 added support for OpenAPI 3 and Spring 5. It also comes with a ready-to-use Spring Boot starter which replaces a host of dependencies that were required in earlier versions. Learn how to use Springfox with a reactive Spring Boot project.
Using Git LFS in CI
Git LFS is the recommended way to version large binary files alongside the source code in Git. Your CI will pull these objects every time it runs the pipeline which can be a problem if you've limited bandwidth. What can you do get around this issue?
Parsing varargs as array with Jackson
Learn how to pass varargs using Jackson for a property on a Java class.
Skipping the GitLab CI
GitLab CI is a pretty nifty tool to run your CI pipelines using Docker. At times, you may want to skip it, though, e.g., when you update a README or LICENSE. Learn how to accomplish this in different ways.
Error handling for a Spring-based REST API
Spring Boot provides useful defaults to handle exceptions and formulate a helpful response. However, in many cases, some customization might be needed. Learn how to customize error responses returned by a REST API with some usecases when Spring Security comes into the picture.
API Documentation with springdoc-openapi
Springdoc is an open-source project that adds support for OpenAPI Specification 3 (OAS 3) in a Spring Boot application. Learn how to use Springdoc with a reactive Spring Boot project.