Spring Cloud Communication & Stakeholder Relations 3 — Questions and Answers
Question 1: A business analyst asks how Spring Cloud OpenFeign simplifies service-to-service communication compared to RestTemplate. What is the key advantage?
- OpenFeign automatically handles database transactions
- OpenFeign generates HTTP client code from a declarative interface, eliminating boilerplate (Correct answer)
- OpenFeign supports GraphQL natively
- OpenFeign uses binary serialization by default
Correct answer: OpenFeign generates HTTP client code from a declarative interface, eliminating boilerplate
OpenFeign lets developers define HTTP clients as annotated interfaces and generates the implementation automatically, drastically reducing boilerplate code.
Question 2: Your team needs to communicate service health status to an SRE team monitoring Spring Boot applications. Which dependency exposes the /actuator/health endpoint with detailed status?
- spring-cloud-starter-config
- spring-boot-starter-actuator (Correct answer)
- spring-cloud-starter-sleuth
- spring-cloud-starter-gateway
Correct answer: spring-boot-starter-actuator
spring-boot-starter-actuator provides the /actuator/health endpoint that reports component-level health details usable by SRE monitoring tools.
Question 3: A security architect asks how Spring Cloud Config Server can protect sensitive property values. What is the recommended approach?
- Store credentials in plain text in a private Git repo
- Use Spring Cloud Config's encryption/decryption with symmetric or asymmetric keys (Correct answer)
- Disable Config Server for production
- Store secrets in application.properties only
Correct answer: Use Spring Cloud Config's encryption/decryption with symmetric or asymmetric keys
Spring Cloud Config supports encrypting property values with symmetric (AES) or asymmetric (RSA) keys via the /encrypt and /decrypt endpoints.
Question 4: A stakeholder asks which Spring Cloud pattern prevents a failing service from taking down its callers. Which concept addresses this?
- Service registry
- Circuit breaker pattern (Correct answer)
- API gateway routing
- Distributed tracing
Correct answer: Circuit breaker pattern
The circuit breaker pattern (implemented via Resilience4j in Spring Cloud) stops calls to a failing service and returns a fallback, protecting callers from cascading failures.
Question 5: An architect wants to communicate to the team how Spring Cloud LoadBalancer differs from Netflix Ribbon. What is the primary distinction?
- Spring Cloud LoadBalancer only supports round-robin; Ribbon supports more algorithms
- Spring Cloud LoadBalancer is actively maintained and Ribbon is in maintenance mode (Correct answer)
- Spring Cloud LoadBalancer requires Kubernetes; Ribbon does not
- Ribbon supports reactive programming; Spring Cloud LoadBalancer does not
Correct answer: Spring Cloud LoadBalancer is actively maintained and Ribbon is in maintenance mode
Spring Cloud LoadBalancer is the actively maintained replacement for Netflix Ribbon, which entered maintenance mode and is no longer recommended for new projects.
Question 6: A QA engineer asks how to test a Spring Cloud OpenFeign client in isolation without calling real services. What is the recommended approach?
- Use @SpringBootTest with a live server
- Use WireMock or MockMvc to stub HTTP responses (Correct answer)
- Disable Feign in test profiles
- Replace Feign with RestTemplate for tests
Correct answer: Use WireMock or MockMvc to stub HTTP responses
WireMock stubs HTTP endpoints locally, allowing Feign clients to be tested in isolation without spinning up real dependent services.
Question 7: When reporting on API Gateway performance to stakeholders, which Spring Cloud Gateway metric indicates the percentage of requests rejected by rate limiting?
- gateway.requests.total
- spring.cloud.gateway.requests.seconds
- resilience4j.ratelimiter.available_permissions (Correct answer)
- resilience4j.ratelimiter.waiting_threads
Correct answer: resilience4j.ratelimiter.available_permissions
The resilience4j.ratelimiter.available_permissions metric shows how many permits remain; when zero, requests are being rejected by the rate limiter.
A business analyst asks how Spring Cloud OpenFeign simplifies service-to-service communication compared to RestTemplate.
What is the key advantage?