/Spring

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 using the latest version of CXF and Spring Boot. Sample App We're going to build a simple Spring Boot app that exposes SOAP web service using Apache CXF.  The service will have a single operation that takes an account number and returns bank account details. If you're impatient and want to jump ahead you can grab [...]

By |2019-06-19T08:22:03+01:00June 19th, 2019|Spring, Spring Boot, Web Services|0 Comments

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 own microservices architecture. In this post we'll look at Feign and Ribbon to see how they can be used in the context of a Spring Boot application. What is Feign? Feign is a library that helps developers create declarative HTTP clients by simply defining an interface and annotating it. At runtime, Feign creates the HTTP client [...]

By |2019-04-19T20:32:05+01:00April 16th, 2019|Micro Services, REST, Spring Boot|1 Comment

Configuring Micro Services – Spring Cloud Config Server

Configuring Micro Services – Spring Cloud Config Server Managing application configuration in a traditional monolith is pretty straight forward. Configuration is usually externalised to one or more property files that sit on the same server as the application. Externalising the configuration makes sense because it allows configuration to be updated without a rebuild and redeploy of the application. It also means that build artifacts are environment agnostic, allowing you to deploy the same artifact to dev, uat, prod etc. Configuring Micro Services The move toward micro services has created a number of new challenges when it comes to configuration. Micro services by definition are [...]

By |2019-03-19T21:28:39+01:00August 2nd, 2018|AWS, Spring Boot|0 Comments

Health Checks, Metrics & More with Spring Boot Actuator

Health Checks, Metrics & More with Spring Boot Actuator I've been working with Spring Boot for a few years now and I'm a big fan. There are lots of things to like about Spring Boot, but one thing that really stands out for me is the emphasis on production readiness. Production Readiness Production readiness is about looking beyond functional requirements and ensuring your application can be properly managed and monitored in production. Some key things to consider when thinking about production readiness are... Health checks Viewing application configuration - application properties, Environment variables etc. Viewing and altering log configuration Viewing application metrics - JVM, classloader, [...]

By |2019-02-07T07:27:16+01:00September 7th, 2017|Spring Boot|0 Comments

REST HATEOAS with Spring

REST HATEOAS with Spring The Richardson maturity model breaks the REST architectural style into various levels of maturity. Level zero describes a system that uses HTTP as a transport mechanism only (also known as URI tunnelling). A single URI and HTTP verb is typically used for all interactions with POX (plain old XML) being posted over the wire. Old school SOAP-RPC is a good level zero example. Level one describes a system that builds on level zero by introducing the notion of resources. Resources typically represent some business entity and are usually described using nouns. Each resource is addressed via a unique URI and a single [...]

By |2019-02-07T08:02:28+01:00July 18th, 2017|REST, Spring Boot|0 Comments

REST Endpoint Testing With MockMvc

REST Endpoint Testing With MockMvc In this post I'm going to show you how to test a Spring MVC Rest endpoint without deploying your application to a server. In the past, full integration tests were the only meaningful way to test a Spring REST endpoint. This involved spinning up a test server like Tomcat or Jetty, deploying the application, calling the test endpoint, running some assertions and then terminating the server. While this is an effective way to test an endpoint, it isn't particularly fast. We're forced to wait while the entire application is stood up, just to test a single endpoint. An alternative approach [...]

By |2019-02-11T07:31:42+01:00May 25th, 2017|REST, Spring Boot, Testing|0 Comments