Connecting Microservices Together

In the previous chapter, we set up our development environment, chose Maven to create the skeleton of our project, and implemented a RESTful web service to provide average temperature information.

In this chapter, we'll start by creating a client that consumes the temperature service we created. We will be using a JAX-RS client API and Jersey open source reference implementation under the hood. We will use JAX-RS 2.1, which is a part of Java EE 8 and Jersey 2.26.

Jersey version 2.26 is the JAX-RS 2.1-compliant version and the latest available version at the time of writing.
It's also possible to use any JAX-RS-compliant implementations instead of Jersey, such as RESTEasy (http://resteasy.jboss.org) or Apache Wink (https://wink.apache.org).

We will also show how to implement the same logic for the client in an asynchronous way. We'll continue by implementing an interaction between two Microservices to demonstrate methods for integration. And finally, for discovering services, we'll register the services that we created into service discovery mechanisms that are available, such as Eureka and SnoopEE.

In this chapter, we are going to cover following topics:

  • Building a client
  • Connecting two Microservices
  • Running Snoop and registering our service
  • Installing and registering Eureka
  • Consuming registered services
  • Discovering and invoking the service
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.89.18