Home Page2021-05-24T23:44:52+01:00

Spring Cloud Config Server on Kubernetes – Part 1

This is the first of a two part article where I'll show you how to use Spring Cloud Config Server to build centralised configuration for your microservices.  In this first post we'll create a Config Service that pulls its data from a Git repo and exposes it to other services. [...]

By |April 11th, 2021|Categories: Kubernetes|Tags: , , , , |

Running Multiple Spring Boot Services with Docker Compose

In this post we'll look at how Docker Compose makes it easier to configure and run multiple containers in your local environment. Why Docker Compose? First up, you don't need Docker compose to run multiple containers. You can do this just fine by manually starting and stopping the containers [...]

By |August 25th, 2020|Categories: Uncategorised|

Spring RestTemplate Request & Response Logging

It's sometimes useful to log HTTP requests and responses when working with a Spring RestTemplate. If you need fine-grained control over exactly what's logged you can use a custom interceptor to add logging before and after the remote call. Creating an Interceptor You'll need to create a class that [...]

By |December 17th, 2019|Categories: RestTemplate, Spring|

Configuring a Custom ObjectMapper for Spring RestTemplate

Configuring a Custom ObjectMapper for Spring RestTemplate One of the great things about RestTemplate is its simplicity. You simply instantiate it like this... RestTemplate restTemplate = new RestTemplate(); and off you go. Under the hood Spring automatically creates and registers a number of message converters to handle various data [...]

By |December 3rd, 2019|Categories: RestTemplate|Tags: , , , |

Jackson JSON Deserialization – UnrecognizedPropertyException

Whats the Problem? I ran into a UnrecognizedPropertyException today trying to deserialize the following JSON. { "Places": [{ "PlaceId": "LOND-sky", "PlaceName": "London", "CountryId": "UK-sky", "RegionId": "", "CityId": "LOND-sky", "CountryName": "United Kingdom" }, { "PlaceId": "LHR-sky", "PlaceName": "London Heathrow", "CountryId": "UK-sky", "RegionId": "", "CityId": "LOND-sky", "CountryName": "United Kingdom" }] } [...]

By |November 26th, 2019|Categories: Jackson, JSON|

Build, Package and Run Spring Boot Apps with Docker

I've recently started playing around with Docker again and have decided to put together a few posts to share what I've learned. In this post  I'll show you how to compile, package and run a simple Spring Boot app in a Docker container. To keep the Docker image as [...]

By |October 1st, 2019|Categories: Containerisation, Docker|

Be Nice – Comment your Code

I've always been a fan of commenting code. To me, it's a no brainer, the sensible thing to do, and a fundamental part of building software that's easy to understand and maintain. Not everyone agrees though. Some argue that comments are unnecessary and simply shine a light on code [...]

By |August 30th, 2019|Categories: Software Engineering Fundamentals|

SOAP Web Services with Apache CXF and Spring Boot

This post is based on one I wrote a few years ago about building contract first web services with Apache CXF and Spring. The previous post didnt use Spring Boot and most of the Spring and CXF configuration was via XML. This post moves things forward a bit by [...]

By |June 19th, 2019|Categories: Spring, Spring Boot, Web Services|Tags: , , , , |

Introduction to Lombok

Java is often criticised for being unnecessarily verbose compared with other languages. Lombok provides a bunch of annotations that generate boilerplate code in the background, removing it from your classes and therefore helping to keep your code clean. Less boilerplate means more concise code that's easier to read and [...]

By |April 30th, 2019|Categories: Java|Tags: , |

Service Integration with Netflix Feign and Ribbon

The guys at Netflix have developed and open sourced (among many other things) Feign and Ribbon.  These libraries can help you as a developer, to build robust, fault tolerant service integrations.  Best of all, they've been tested in the wild by Netflix, who use both libraries extensivley in their [...]

By |April 16th, 2019|Categories: Micro Services, REST, Spring Boot|Tags: , , , , |
Go to Top