Build self-healing distributed systems with Spring Cloud

Meet the microservices challenge with Spring Cloud and Netflix OSS

1 2 Page 2
Page 2 of 2

Spring Cloud has created an embedded Zuul proxy to ease the development of a very common use case where a UI application wants to proxy calls to one or more back-end services. This feature is convenient for a user interface to proxy to the back-end services it requires, avoiding the need to manage CORS (cross-origin resource sharing) and authentication concerns independently for all the back ends. An important application of the Zuul proxy is as an implementation of the API gateway pattern (Figure 7).

API gateway pattern

Figure 7: API gateway pattern

Spring Cloud has enhanced the embedded Zuul proxy to provide for automatic handling of file uploads, and with the addition of Spring Cloud Security can easily provide for OAuth2 SSO, as well as token relay to downstream services. Zuul uses Ribbon as its client and load balancer for all outbound requests. Ribbon’s dynamic server lists are normally populated from Eureka, but Spring Cloud is capable of populating them from other sources. The Spring Cloud Lattice project has demonstrated the ability to populate Ribbon’s server lists by polling Cloud Foundry Diego’s Receptor API.

Entering the world of microservices leads us straight into the world of distributed systems, and distributed systems don’t “just work.” Therefore, we must assume that the behavior and locations of the components of our system will constantly change, often in unpredictable ways. We’ve covered several boilerplate patterns than can help us address these challenges, as well as their implementations found in Netflix OSS and Spring Cloud. I invite you to try them out as you begin your quest to build systems that “run forever, self-heal, and scale.”

Matt Stine is a Cloud Foundry platform engineer at Pivotal. He is a 15-year veteran of the enterprise IT industry, with experience spanning numerous business domains. He currently specializes in helping customers achieve success with PaaS using Cloud Foundry and BOSH. Matt has spoken at conferences ranging from JavaOne to OSCON, is a regular speaker on theNo Fluff Just Stuff tour, and serves as technical editor of NFJS, the Magazine. Matt is also the founder and past president of the Memphis/Mid-South Java User Group.

This story, "Build self-healing distributed systems with Spring Cloud" was originally published by InfoWorld.

1 2 Page 2
Page 2 of 2