Spring Cloud Technology & Digital Applications 2 — Questions and Answers
Question 1: Which Spring Cloud component provides a pattern for preventing cascading failures across microservices?
- Spring Cloud Gateway
- Spring Cloud Circuit Breaker (Correct answer)
- Spring Cloud Bus
- Spring Cloud Sleuth
Correct answer: Spring Cloud Circuit Breaker
Spring Cloud Circuit Breaker abstracts circuit breaker implementations (Resilience4j, Sentinel) to stop cascading failures between services.
Question 2: In Spring Cloud Config Server, which backend store is used by default to store configuration files?
- Consul key-value store
- Vault secrets engine
- Git repository (Correct answer)
- Local filesystem only
Correct answer: Git repository
Spring Cloud Config Server defaults to a Git repository backend, enabling version-controlled externalized configuration.
Question 3: What annotation enables a Spring Boot application to act as a Eureka Discovery Server?
- @EnableDiscoveryClient
- @EnableEurekaServer (Correct answer)
- @EnableServiceRegistry
- @EnableCloudServer
Correct answer: @EnableEurekaServer
@EnableEurekaServer placed on the main class turns the application into a Netflix Eureka service registry.
Question 4: Spring Cloud Gateway uses which programming model for routing HTTP requests?
- Servlet-based blocking I/O
- Reactive (Project Reactor / WebFlux) (Correct answer)
- Netty with callbacks only
- Traditional MVC DispatcherServlet
Correct answer: Reactive (Project Reactor / WebFlux)
Spring Cloud Gateway is built on Spring WebFlux and Project Reactor, making it fully non-blocking and reactive.
Question 5: Which property file suffix does a Spring Cloud Config client use to request a profile-specific configuration?
- application-{profile}.yml
- application_{profile}.yml
- config-{profile}.properties
- {app}-{profile}.yml (Correct answer)
Correct answer: {app}-{profile}.yml
Config Server resolves files named {application}-{profile}.yml (or .properties) for profile-specific overrides.
Question 6: Which Spring Cloud module propagates distributed trace IDs automatically across service calls using Micrometer?
- Spring Cloud Stream
- Spring Cloud Sleuth / Micrometer Tracing (Correct answer)
- Spring Cloud Bus
- Spring Cloud Function
Correct answer: Spring Cloud Sleuth / Micrometer Tracing
Spring Cloud Sleuth (now integrated as Micrometer Tracing) auto-instruments HTTP and messaging calls with trace and span IDs.
Question 7: When using Spring Cloud LoadBalancer, what interface must you implement to provide a custom load-balancing algorithm?
- ReactorServiceInstanceLoadBalancer (Correct answer)
- IRule
- LoadBalancerInterceptor
- RibbonClient
Correct answer: ReactorServiceInstanceLoadBalancer
ReactorServiceInstanceLoadBalancer is the interface to implement for custom reactive load-balancing logic in Spring Cloud LoadBalancer.
Which Spring Cloud component provides a pattern for preventing cascading failures across microservices?