Spring Cloud Communication & Stakeholder Relations 5 — Questions and Answers
Question 1: A product owner wants to know what fallback behavior Spring Cloud Resilience4j provides when a circuit is OPEN. What should the developer implement?
- The service blocks the thread until the circuit closes
- A fallback method or Fallback Factory returns a default response instead of calling the failing service (Correct answer)
- Resilience4j restarts the downstream service automatically
- Spring retries the call indefinitely until success
Correct answer: A fallback method or Fallback Factory returns a default response instead of calling the failing service
When the circuit is OPEN, Resilience4j invokes a configured fallback method or factory that returns a safe default, preventing calls to the failing downstream service.
Question 2: A CTO asks how Spring Cloud handles the communication pattern where a service produces events consumed by multiple downstream services without tight coupling. Which component enables this?
- Spring Cloud Gateway
- Spring Cloud Stream with a message broker binder (Correct answer)
- Spring Cloud Config
- Spring Cloud Sleuth
Correct answer: Spring Cloud Stream with a message broker binder
Spring Cloud Stream provides an abstraction over message brokers (Kafka, RabbitMQ) that decouples producers and consumers via named channels.
Question 3: A stakeholder asks how to enforce that only authenticated services can call internal APIs in a Spring Cloud microservices architecture. Which approach is most robust?
- IP whitelisting at the gateway only
- Mutual TLS (mTLS) authentication between services (Correct answer)
- Shared API keys stored in environment variables
- Disable external DNS for internal services
Correct answer: Mutual TLS (mTLS) authentication between services
Mutual TLS requires both caller and receiver to present certificates, providing strong cryptographic authentication between services without relying on network-level controls alone.
Question 4: During a sprint review, a developer explains that a Feign client is experiencing slow calls. Which Resilience4j feature can be layered with Feign to reject calls that exceed a duration threshold?
- CircuitBreaker
- Retry
- TimeLimiter (Correct answer)
- Bulkhead
Correct answer: TimeLimiter
TimeLimiter enforces a maximum call duration and cancels calls that exceed the configured timeout, complementing circuit breaker protection for slow dependencies.
Question 5: A stakeholder asks how Spring Cloud Gateway propagates the original client's trace context to downstream services. What mechanism ensures this?
- Gateway re-generates a new trace ID for each downstream call
- Gateway forwards B3 propagation headers (X-B3-TraceId, X-B3-SpanId) injected by Sleuth (Correct answer)
- Developers must manually copy headers in each filter
- Trace context is stored in a shared Redis cache
Correct answer: Gateway forwards B3 propagation headers (X-B3-TraceId, X-B3-SpanId) injected by Sleuth
Spring Cloud Sleuth integrated with Gateway automatically injects and forwards B3 propagation headers so the full request chain shares the same trace ID.
Question 6: An architect needs to explain to the team the difference between Spring Cloud Gateway's global filters and route-specific filters. What is correct?
- Global filters apply to all routes; route-specific filters apply only to their configured route (Correct answer)
- Route-specific filters always override global filters regardless of order
- Global filters only apply to authenticated routes
- There is no functional difference between them
Correct answer: Global filters apply to all routes; route-specific filters apply only to their configured route
Global filters execute for every request passing through the gateway, while route-specific filters are scoped to individual routes defined in the routing configuration.
Question 7: A release manager asks how Spring Cloud enables zero-downtime configuration updates without restarting services. Which combination of features supports this?
- Config Server + Spring Cloud Bus + @RefreshScope beans (Correct answer)
- Eureka + Ribbon + circuit breaker
- Feign + Hystrix + Zipkin
- Gateway + Sleuth + Vault
Correct answer: Config Server + Spring Cloud Bus + @RefreshScope beans
@RefreshScope marks beans to be re-created on a refresh event, and Spring Cloud Bus broadcasts the refresh signal so all instances pick up new config without restart.
A product owner wants to know what fallback behavior Spring Cloud Resilience4j provides when a circuit is OPEN.
What should the developer implement?