Spring Cloud Communication & Stakeholder Relations 4 — Questions and Answers
Question 1: A stakeholder wants to understand how service instances register themselves in Spring Cloud. Which annotation on the main class enables Eureka client registration?
- @EnableDiscoveryClient (Correct answer)
- @EnableConfigServer
- @EnableFeignClients
- @EnableCircuitBreaker
Correct answer: @EnableDiscoveryClient
@EnableDiscoveryClient activates the service discovery client, allowing the application to register with and query a Eureka (or Consul/Zookeeper) registry.
Question 2: A project manager asks what happens to in-flight requests during a rolling deployment when Spring Cloud LoadBalancer removes a deregistering instance. Which mechanism protects these requests?
- Immediate 503 is returned to callers
- Graceful shutdown with a configurable drain period allows in-flight requests to complete (Correct answer)
- LoadBalancer retries on a new instance automatically always
- The deregistering instance stays in registry forever
Correct answer: Graceful shutdown with a configurable drain period allows in-flight requests to complete
Spring Boot's graceful shutdown feature gives the server a drain period to finish in-flight requests before terminating, preventing abrupt failures during rolling deploys.
Question 3: A DevOps engineer asks how to communicate a new Spring Cloud Config property to only a subset of microservices without restarting all of them. What is the best approach?
- Restart all services manually
- Use Spring Cloud Bus with destination filtering to target specific services (Correct answer)
- Edit properties in running JVM memory directly
- Redeploy only one service at a time
Correct answer: Use Spring Cloud Bus with destination filtering to target specific services
Spring Cloud Bus supports destination filtering on the /actuator/busrefresh/{destination} endpoint to trigger refresh only on specific service instances.
Question 4: A compliance officer asks whether Spring Cloud Sleuth's trace data can be exported to Zipkin for audit purposes. What configuration is required?
- Add spring-cloud-starter-zipkin and set spring.zipkin.baseUrl (Correct answer)
- Install a Zipkin agent on each JVM
- Configure Kafka as the Sleuth backend
- Enable Zipkin in Eureka dashboard settings
Correct answer: Add spring-cloud-starter-zipkin and set spring.zipkin.baseUrl
Adding spring-cloud-starter-zipkin and configuring spring.zipkin.baseUrl enables automatic trace export from Sleuth to a Zipkin server.
Question 5: A stakeholder asks how Spring Cloud Gateway handles retries for failed upstream service calls. Which filter provides this capability?
- RewritePath filter
- Retry GatewayFilter (Correct answer)
- CircuitBreaker GatewayFilter
- SetStatus filter
Correct answer: Retry GatewayFilter
The Retry GatewayFilter in Spring Cloud Gateway retries failed requests a configurable number of times on specified HTTP status codes or exceptions.
Question 6: When communicating service discovery strategy to a cloud-native team, which Spring Cloud discovery client is most suitable for a Kubernetes-native deployment?
- Netflix Eureka
- Spring Cloud Kubernetes DiscoveryClient (Correct answer)
- Hashicorp Consul
- Apache Zookeeper
Correct answer: Spring Cloud Kubernetes DiscoveryClient
Spring Cloud Kubernetes DiscoveryClient queries Kubernetes Services and Endpoints APIs directly, making it the native choice for Kubernetes deployments.
Question 7: A team lead wants to explain to stakeholders why Spring Cloud Config uses Git as a backend by default. What is the primary benefit?
- Git provides faster property lookups than databases
- Git gives full audit history, branching, and rollback for configuration changes (Correct answer)
- Git is the only backend Spring Cloud Config supports
- Git encrypts properties automatically
Correct answer: Git gives full audit history, branching, and rollback for configuration changes
Using Git means every configuration change is version-controlled with full history, diff, rollback capability, and branch support for environment-specific configs.
A stakeholder wants to understand how service instances register themselves in Spring Cloud.
Which annotation on the main class enables Eureka client registration?