SSL-Based/Secured FeignClient Example in Java Microservices With Eureka

Prerequisite:

  • You should have one Discovery Server up and running
  • An SSL based microservice registered with the above Discovery Server up and running which we are going to consume from below FeignClient
  • You need to generate your client application's keystore and trust store. You need to add your server certificate into your client application's trustStore and add your client application's certificate in the Server application's trustStore.

Before reading this article make sure that you know about Spring Feign Client. In this article, I will explain how to develop a Feign Client application/service to establish two way SSL based communication. In simple words, how a Feign Client can make an HTTPS REST service call. Also for this project, I assumed that we have a Eureka discovery server and one SSL based Spring boot microservice called global-repository. In other words from our FeignClient below, we are going to consume an SSL based microservice (global-repository)with a valid certificate.