Spring Cloud Technology & Digital Applications 3 — Questions and Answers
Question 1: Which Spring Cloud Stream binder is used to integrate with Apache Kafka?
- spring-cloud-stream-binder-rabbit
- spring-cloud-stream-binder-kafka (Correct answer)
- spring-cloud-stream-binder-kinesis
- spring-cloud-stream-binder-pulsar
Correct answer: spring-cloud-stream-binder-kafka
The spring-cloud-stream-binder-kafka dependency wires Spring Cloud Stream to an Apache Kafka broker.
Question 2: What is the role of the Spring Cloud Bus?
- Routes HTTP traffic between microservices
- Broadcasts configuration-change events across multiple service instances (Correct answer)
- Manages distributed transactions
- Provides a service mesh sidecar
Correct answer: Broadcasts configuration-change events across multiple service instances
Spring Cloud Bus links nodes of a distributed system via a message broker so that config refresh events can be broadcast to all instances at once.
Question 3: Which annotation on a Feign client method tells Spring Cloud OpenFeign to use a specific path variable?
- @RequestParam
- @PathVariable (Correct answer)
- @FeignVariable
- @RouteVar
Correct answer: @PathVariable
@PathVariable maps a URI template variable to a method parameter in a Feign client interface, just as in Spring MVC.
Question 4: In Spring Cloud Kubernetes, what Kubernetes resource is used as the equivalent of a Config Server to supply application properties?
- Deployment manifest
- ConfigMap (Correct answer)
- ServiceAccount
- PersistentVolumeClaim
Correct answer: ConfigMap
Spring Cloud Kubernetes reads ConfigMaps and Secrets to inject externalized configuration into Spring Boot applications running in a cluster.
Question 5: What does setting `spring.cloud.gateway.discovery.locator.enabled=true` accomplish?
- Enables JWT validation on all routes
- Automatically creates routes for every registered service in the discovery registry (Correct answer)
- Turns on reactive WebSocket support
- Enables rate limiting per service
Correct answer: Automatically creates routes for every registered service in the discovery registry
Discovery locator integration tells Spring Cloud Gateway to auto-generate routes for each service instance found in the service registry.
Question 6: Which resilience pattern does Resilience4j's TimeLimiter implement in Spring Cloud Circuit Breaker?
- Retry with exponential back-off
- Bulkhead isolation
- Timeout enforcement (Correct answer)
- Rate limiting
Correct answer: Timeout enforcement
TimeLimiter wraps calls with a configurable maximum duration, returning a fallback or error if the upstream exceeds the timeout.
Question 7: Which Spring Cloud component provides a client-side API gateway pattern using reactive streams?
- Spring Cloud Netflix Zuul
- Spring Cloud Gateway (Correct answer)
- Spring Cloud Consul
- Spring Cloud OpenFeign
Correct answer: Spring Cloud Gateway
Spring Cloud Gateway is the modern reactive replacement for Zuul, serving as the client-facing edge router in a microservices architecture.
Which Spring Cloud Stream binder is used to integrate with Apache Kafka?