
Explore microservice architecture for an online store with a public world and private world, enabling create and buy flows via HTTP between inventory and user session services.
Feign is a library to create Java-based http clients based on interfaces, eliminating boilerplate. Configure encoders and decoders for json, with spring integration, and enable asynchronous calls and resiliency.
Outline the architecture for a microservices-based online store using Spring Boot, Gradle, and Java 11, with three projects—online store service, inventory service, and user session service—prepping future Spring Cloud integration.
Use a Feign client with @RequestLine and @Param to validate user sessions between the online store and the user session service, implementing session validation and a response type for result.
Configure Spring Cloud Feign with a Jackson encoder and decoder to deserialize JSON responses, map them to the user session validator response, and enforce forbidden access on invalid sessions.
Enable logging for feign with slf4j by setting the full debug level and the logger adapter, enable logs via application properties, and note http 1.1 despite http/2 support.
Use the @QueryMap annotation to pass dynamic query parameters with a string to object map, enabling different parameter sets for various use cases in a Feign client.
Use Java eight default methods with @QueryMap to create dynamic query parameters for a user session client, enabling a validated session method that delegates to the underlying API.
Learn how to model query parameters with POJOs to generate request parameters for a Spring Cloud Feign client, using a query map, custom encoders, and getters and setters.
Post json data to create new products in the inventory service using spring cloud feign and @headers, with request and response models and an in-memory product store.
Learn to handle custom request parameters with a custom expander that converts offset date time to milliseconds, register a formatter, and apply it across microservice calls.
Learn to pass dynamic headers in Feign using the header map annotation, building a string-object map (like X source) to customize headers per use case.
Define a health API that aggregates downstream service health status using a base client pattern with spring cloudFeign.
Implement a custom request interceptor to propagate the source header across downstream services, ensuring tracing with X source, via Feign clients and header configuration.
Implement a custom Feign error decoder to translate downstream errors into domain exceptions, and propagate downstream messages via an API exception handler for 400 and 500 responses.
Learn how Spring Cloud Feign retries failed requests by default five times, handling IO exceptions and the retrievable exceptions, with exponential backoff and configurable min and max wait times.
Customize request options by configuring the connection timeout, timeout, and follow redirects on the client builder; learn default values, including ten-second connection timeout, and see five retries across service calls.
Learn how Spring Cloud Feign follows redirects by default, using the location header to route to a new API version, and how to enable or disable this behavior.
Configure Feign clients to return CompletableFuture for asynchronous http calls and enable non-blocking execution. Use future.get to retrieve the actual response when required after background processing.
Configure Dropwizard metrics for Feign clients by creating a shared metric registry, starting a reporter, and exposing client metrics for inventory service calls; verify via JConsole and Postman.
Configure micrometer metrics by adding a meter registry with default configuration and the system clock to the inventory service, exposing metrics on first invocation for Prometheus or your chosen system.
Rewrite the store service using Spring Cloud OpenFeign to define Feign clients with Spring MVC annotations, replacing legacy Feign dependencies, and enable logging and error decoding.
Learn to implement async Feign clients in Spring by crafting a custom target with reflection, preserve decoders, and validate health checks and session data across services.
Learn maintainable error handling in spring cloud feign by building a custom exception handler workflow with an annotation-driven approach and a tailored error decoder.
Learn how to register services with Eureka, enable a Eureka server and clients, and use logical service names for dynamic discovery, failover, and load balancing across instances.
Learn how Feign client fallbacks with a fallback factory and circuit breaker handle unavailable services like the user session service in a Eureka-enabled architecture.
Configure Resilience4J circuit breakers to protect services by using a sliding window and a failure-rate threshold, opening on failures and transitioning through open and half-open states.
Configure a time limiter with resilience4j to cap slow downstream calls, adjusting the default 1-second wait to a custom duration (e.g., five seconds) and observe how timeouts trigger circuit-breaking behavior.
Use slowness based circuit breaking to open the circuit when downstream latency exceeds a duration threshold, with an 80 percent window to trigger on multiple slow calls.
Configure Spring Boot to expose circuit breaker metrics via Spring Actuator, enabling health endpoint with circuit breakers details and exposing metrics and circuit breaker events for Prometheus.
Balance requests across multiple service instances with Eureka using a round-robin strategy, verify health, and observe traffic distribution through multiple ports and instances.
Explore emulating Feign client behavior with WireMock to perform integration testing of http clients, validate request and response mappings, and test load balancing and circuit breaking.
Demonstrate testing client-side load balancing for a user session service by spinning two service instances, invoking the health API, and asserting results show 204 and 403 in any order.
Demonstrate Resilience4j error-based circuit breaking by testing a user session service, configuring a five-request window and 20 percent failures, and validating open and half-open states.
Test slowness-based circuit breaking with Resilience4j using wiremock, configuring a two-second threshold and 80 percent slow samples, then verify open state and recovery with fast responses.
Configure a five-second resilience4j time limiter, trigger the session service via the extra theater API, and verify traffic cut-off with a stopwatch to observe 500 error and timeout exception.
Explore building a microservice system with Spring Cloud Feign, implement circuit breakers with resilience4j, enable client-side load balancing with Eureka, and test request and response mappings.
In this very practical course, you'll learn how to do effective microservice HTTP communication using Feign and Spring Cloud OpenFeign.
Nowadays microservices are everywhere. We need to learn how to use the architecture to our advantage to achieve the targeted goals. I'll help you to understand how to build a resilient communication channel between your services.
The course curriculum includes a lot of exciting pieces:
Regular Feign annotations and mappings
Retries
Custom error handling
Timeout handling
Async communication
Spring Cloud OpenFeign configuration
Resilience4J circuit breakers
Resilience4J time limiters
Integrating Spring Cloud Eureka service registry
Client side load balancing
Integration testing the API clients using WireMock
Integration testing circuit breakers, time limtiers and load balancing using WireMock
And that's just a high-level overview what's covered. The course includes non-stop coding where we'll build a complex microservice system to make sure you understand the concepts in detail.
Mastering how to build a reliable communication between your services is critical for every product. In a microservice system, everything can break, even your communication. During this course you'll learn the tools to ensure your messages hit the destination.
Another important question, making sure your individual services can scale to the load. What if they cannot? How to configure your API clients to cope with this and make sure we're not overloading the services? Using Resilience4J and Spring Cloud OpenFeign, we'll hit this milestone very quickly.
Testing microservices was never easy. On the contrary, it's a question most engineers would avoid. Using WireMock and combining it with Spring Cloud OpenFeign, I'll show you how to test your request/response mappings, circuit breakers, load balancing, and much more.