Spring Cloud Professional Standards & Competencies 5 — Questions and Answers
Question 1: Which metric dimension should a Spring Cloud architect monitor to assess the health of a circuit breaker in production?
- JVM heap size only
- Circuit breaker state (CLOSED, OPEN, HALF_OPEN), call volume, and failure rate (Correct answer)
- Number of Git commits to the config repository
- Container CPU throttling events
Correct answer: Circuit breaker state (CLOSED, OPEN, HALF_OPEN), call volume, and failure rate
Monitoring circuit breaker state transitions, call volume, and failure rate together provides a complete picture of dependency health and failure tolerance.
Question 2: What does following the 12-Factor App principle of 'backing services' mean in the context of Spring Cloud configuration?
- All backing services must be deployed in the same JVM
- Databases, queues, and caches should be treated as attached resources configured via environment or config server, not hardcoded (Correct answer)
- Backing services should never be restarted
- Spring Cloud applications should use only in-memory stores
Correct answer: Databases, queues, and caches should be treated as attached resources configured via environment or config server, not hardcoded
Treating backing services as attached resources means their connection details come from configuration (not code), enabling seamless environment promotion and swapping.
Question 3: A senior engineer notices that Spring Cloud microservices are making synchronous HTTP calls for operations that don't require immediate responses. What professional improvement should they recommend?
- Add more timeouts to the synchronous calls
- Refactor to event-driven, asynchronous messaging via Spring Cloud Stream (Correct answer)
- Double the number of service instances
- Convert all services to use gRPC instead
Correct answer: Refactor to event-driven, asynchronous messaging via Spring Cloud Stream
Replacing unnecessary synchronous calls with asynchronous event-driven messaging via Spring Cloud Stream reduces coupling and improves overall system resilience and throughput.
Question 4: What is the professional implication of setting a very low timeout on a Feign client in Spring Cloud?
- It increases the maximum response payload size
- It can cause premature failures for operations that legitimately need more processing time, increasing error rates (Correct answer)
- It automatically retries failed requests indefinitely
- It disables circuit breaker integration
Correct answer: It can cause premature failures for operations that legitimately need more processing time, increasing error rates
Excessively low timeouts cause valid requests to fail unnecessarily; timeouts must be calibrated against actual P99 response time baselines with headroom for variance.
Question 5: Which Spring Cloud practice supports the principle of 'design for failure' in distributed systems?
- Assuming all services are always available and coding accordingly
- Implementing timeouts, retries with exponential backoff, circuit breakers, and fallbacks for every inter-service call (Correct answer)
- Deploying all microservices on a single server to reduce network latency
- Using only synchronous blocking calls to simplify error handling
Correct answer: Implementing timeouts, retries with exponential backoff, circuit breakers, and fallbacks for every inter-service call
Designing for failure means proactively implementing resilience patterns — timeouts, retries, circuit breakers, and fallbacks — so partial failures don't cascade into full outages.
Question 6: What is the professional recommendation for managing secrets (API keys, passwords) in Spring Cloud Config Server?
- Store them as plaintext in Git alongside other configuration
- Encrypt secrets using Config Server's encryption support or delegate to a vault like HashiCorp Vault (Correct answer)
- Embed secrets directly in Docker images
- Share secrets via Slack channels for team access
Correct answer: Encrypt secrets using Config Server's encryption support or delegate to a vault like HashiCorp Vault
Secrets must be encrypted at rest — either using Config Server's symmetric/asymmetric encryption or by integrating with a dedicated secrets manager like HashiCorp Vault.
Question 7: A Spring Cloud team wants to validate that their microservices integration contracts remain consistent as code evolves. Which professional practice best addresses this?
- Manual end-to-end testing before every deployment
- Consumer-driven contract testing using Spring Cloud Contract (Correct answer)
- Deploying all services simultaneously on each release
- Running integration tests only in production
Correct answer: Consumer-driven contract testing using Spring Cloud Contract
Spring Cloud Contract enables consumer-driven contract testing where API contracts are verified independently on both producer and consumer sides, catching breaking changes before deployment.
Which metric dimension should a Spring Cloud architect monitor to assess the health of a circuit breaker in production?