VMware Spring Professional Develop (Spring Cloud) — Questions and Answers
Question 1: In Spring Cloud Gateway, which built-in filter adds a request rate limiting capability to protect downstream services?
- ThrottleGatewayFilter
- RequestRateLimiter GatewayFilter (Correct answer)
- RateLimit GatewayFilter
- QuotaFilter
Correct answer: RequestRateLimiter GatewayFilter
The RequestRateLimiter GatewayFilter factory in Spring Cloud Gateway uses a backend (e.g., Redis) to enforce rate limits on incoming requests per key.
Question 2: What is the purpose of the `RewritePath` filter in Spring Cloud Gateway?
- Converts query parameters to path variables
- Rewrites HTTP headers to match downstream service expectations
- Transforms the request URI path using a regex pattern before forwarding (Correct answer)
- Rewrites the hostname of the downstream service URL
Correct answer: Transforms the request URI path using a regex pattern before forwarding
The RewritePath filter uses a regex replacement to transform the incoming request path into a new path before the request is forwarded to the downstream service.
Question 3: What is the role of a fallback method in a Spring Cloud circuit breaker setup?
- Automatically retry the failed operation
- Log errors to an external monitoring system
- Roll back database transactions on failure
- Provide an alternative response when the primary method fails or the circuit is open (Correct answer)
Correct answer: Provide an alternative response when the primary method fails or the circuit is open
A fallback method returns a default or cached response when the circuit is open or the primary method throws an exception, maintaining graceful degradation.
Question 4: What is the default sliding window type used by Resilience4j circuit breakers?
- COUNT_BASED (Correct answer)
- THRESHOLD_BASED
- RATE_BASED
- TIME_BASED
Correct answer: COUNT_BASED
Resilience4j defaults to a COUNT_BASED sliding window, which tracks the outcome of the last N calls to compute the failure rate.
Question 5: Which Spring Cloud component replaces Netflix Ribbon for client-side load balancing?
- Spring Cloud LoadBalancer (Correct answer)
- Spring Cloud Proxy
- Spring Cloud Router
- Spring Cloud Balancer
Correct answer: Spring Cloud LoadBalancer
Spring Cloud LoadBalancer is the Spring-native replacement for the deprecated Netflix Ribbon, providing pluggable client-side load balancing strategies.
Question 6: Why is evidence-based practice important in Spring Cloud?
- It replaces experience
- It only applies to academic settings
- It integrates best available evidence with professional expertise for optimal outcomes (Correct answer)
- It is a theoretical concept only
Correct answer: It integrates best available evidence with professional expertise for optimal outcomes
This is fundamental to Spring Cloud practice. It integrates best available evidence with professional expertise for optimal outcomes represents the professional standard for research in the Spring Cloud certification framework.
Question 7: Which Spring Boot Actuator endpoint provides a live view of all active circuit breaker states?
- /actuator/breakers/status
- /actuator/health/circuitBreaker
- /actuator/resilience4j
- /actuator/circuitbreakers (Correct answer)
Correct answer: /actuator/circuitbreakers
The /actuator/circuitbreakers endpoint (provided by resilience4j-spring-boot2) lists all circuit breaker instances and their current states.
Question 8: Which Spring Cloud component provides service registration and discovery using Netflix Eureka?
- Spring Cloud Gateway
- Spring Cloud Config
- Spring Cloud Netflix Eureka (Correct answer)
- Spring Cloud Sleuth
Correct answer: Spring Cloud Netflix Eureka
Spring Cloud Netflix Eureka provides a service registry where microservices register themselves and discover other services.
Question 9: What is the purpose of the `bootstrap.yml` file in a Spring Cloud Config Client application?
- It is loaded before the application context and used to configure the Config Server connection (Correct answer)
- It overrides all other property files at runtime
- It defines the database schema for the application
- It stores encrypted secrets that are decrypted at startup
Correct answer: It is loaded before the application context and used to configure the Config Server connection
bootstrap.yml is processed by a bootstrap context that starts before the main application context, allowing Config Server settings to be available when the app context initializes.
Question 10: What Spring Boot Actuator property must be set to true to expose Resilience4j circuit breaker health indicators?
- resilience4j.circuitbreaker.health.enabled
- spring.cloud.resilience.health
- actuator.resilience4j.indicators.enabled
- management.health.circuitbreakers.enabled (Correct answer)
Correct answer: management.health.circuitbreakers.enabled
Setting management.health.circuitbreakers.enabled=true exposes circuit breaker health indicators via the Spring Boot Actuator /actuator/health endpoint.
Question 11: Which Eureka configuration property controls how long the server waits before evicting an instance that has stopped sending heartbeats?
- eureka.instance.heartbeat-interval
- eureka.server.eviction-interval-timer-in-ms
- eureka.client.registry-fetch-interval-seconds
- eureka.instance.lease-expiration-duration-in-seconds (Correct answer)
Correct answer: eureka.instance.lease-expiration-duration-in-seconds
eureka.instance.lease-expiration-duration-in-seconds sets the time (default 90s) after which Eureka considers an instance expired if no heartbeat is received.
Question 12: What annotation is used to enable a Spring Boot application to act as a Eureka Server?
- @EnableEurekaServer (Correct answer)
- @EnableServiceRegistry
- @EnableDiscoveryClient
- @EnableEurekaClient
Correct answer: @EnableEurekaServer
@EnableEurekaServer placed on the main application class activates the Eureka Server auto-configuration.
Question 13: Which Spring Cloud feature allows services to obtain a list of available instances for a specific service ID programmatically?
- DiscoveryClient.getInstances(serviceId) (Correct answer)
- EurekaClient.fetchRegistry(serviceId)
- LoadBalancer.resolve(serviceId)
- ServiceLocator.find(serviceId)
Correct answer: DiscoveryClient.getInstances(serviceId)
DiscoveryClient.getInstances(serviceId) returns a list of ServiceInstance objects representing all healthy instances registered under that service ID.
Question 14: When using Resilience4j Retry with Spring Cloud, what risk does setting maxAttempts too high introduce for non-idempotent operations?
- Circuit breaker opens prematurely due to retry metrics pollution
- Duplicate side effects such as multiple payments or order submissions (Correct answer)
- Retry exhaustion logs filling disk storage
- Eureka re-registration on every retry
Correct answer: Duplicate side effects such as multiple payments or order submissions
Retrying non-idempotent operations like POST to create a payment can cause the same action to execute multiple times, resulting in duplicate transactions or data corruption.
Question 15: In Spring Cloud with Consul, what is used to perform health checks on registered services?
- Kubernetes liveness probes
- Spring Boot Actuator metrics endpoint
- Consul's built-in health check (HTTP, TTL, or script) (Correct answer)
- Eureka heartbeat mechanism
Correct answer: Consul's built-in health check (HTTP, TTL, or script)
Spring Cloud Consul configures Consul's native health check system (HTTP endpoint, TTL, or script checks) to monitor registered service instances.
Question 16: What are the three states a circuit breaker cycles through in the circuit breaker pattern?
- Enabled, Disabled, Testing
- Closed, Open, Half-Open (Correct answer)
- Running, Stopped, Paused
- Active, Inactive, Pending
Correct answer: Closed, Open, Half-Open
A circuit breaker transitions between Closed (normal operation), Open (rejecting calls after failures), and Half-Open (testing recovery) states.
Question 17: Which Resilience4j module provides time-limited execution for Spring Cloud service calls to prevent thread starvation?
- Bulkhead
- RateLimiter
- CircuitBreaker
- TimeLimiter (Correct answer)
Correct answer: TimeLimiter
TimeLimiter cancels a call that exceeds a configured duration, preventing threads from blocking indefinitely on slow downstream services.
Question 18: In Eureka's self-preservation mode, what triggers the server to stop evicting instances?
- Network latency exceeds 500ms
- More than 10 instances are registered
- Received heartbeats fall below the expected threshold (Correct answer)
- CPU usage exceeds 80%
Correct answer: Received heartbeats fall below the expected threshold
Eureka activates self-preservation mode when the percentage of received heartbeats drops below the expected threshold, preventing mass eviction during network partitions.
Question 19: What is the purpose of the `spring.application.name` property in a Spring Cloud microservice?
- Defines the HTTP server port
- Sets the JVM process name
- Configures the log file name
- Acts as the service ID used for registration and discovery (Correct answer)
Correct answer: Acts as the service ID used for registration and discovery
spring.application.name serves as the virtual hostname and service ID under which the application registers with the discovery server.
Question 20: Which Spring Cloud project provides service discovery support using HashiCorp Consul?
- Spring Cloud Consul (Correct answer)
- Spring Cloud Kubernetes
- Spring Cloud Netflix
- Spring Cloud Zookeeper
Correct answer: Spring Cloud Consul
Spring Cloud Consul integrates with HashiCorp Consul for service discovery, distributed configuration, and health checking.
Question 21: What is the role of a Eureka peer in a high-availability Eureka setup?
- It performs health checks on registered services
- Eureka servers replicate registry data to each other for redundancy (Correct answer)
- It acts as a backup database for service metadata
- It acts as a load balancer for incoming client requests
Correct answer: Eureka servers replicate registry data to each other for redundancy
In a clustered Eureka setup, each server instance replicates its registry to peer servers so that client discovery continues if one server fails.
Question 22: What is the default interval at which Eureka clients send heartbeats to the server?
- 60 seconds
- 30 seconds (Correct answer)
- 5 seconds
- 10 seconds
Correct answer: 30 seconds
By default, Eureka clients send a heartbeat every 30 seconds to renew their lease with the server.
Question 23: For FedRAMP compliance, a Spring Cloud application must implement continuous monitoring. Which tool combination best supports this?
- Spring Cloud Stream + Kafka
- Spring Cloud Contract + WireMock
- Spring Cloud Sleuth + Zipkin only
- Spring Boot Actuator + Micrometer + Prometheus/Grafana (Correct answer)
Correct answer: Spring Boot Actuator + Micrometer + Prometheus/Grafana
Spring Boot Actuator exposes metrics, Micrometer collects them, and Prometheus/Grafana provide the continuous monitoring dashboards required by FedRAMP.
Question 24: What are the three states of a Resilience4j circuit breaker?
- Connected, Disconnected, Reconnecting
- Active, Inactive, Standby
- Open, Closed, Half-Open (Correct answer)
- Running, Stopped, Paused
Correct answer: Open, Closed, Half-Open
A Resilience4j circuit breaker transitions between Closed (normal operation), Open (blocking calls), and Half-Open (testing recovery) states.
Question 25: What does the `@LoadBalanced` annotation do when applied to a RestTemplate bean in Spring Cloud?
- Enables connection pooling for HTTP connections
- Adds retry logic on HTTP 5xx responses
- Enables circuit breaking on all requests
- Intercepts requests to resolve logical service names via the discovery client (Correct answer)
Correct answer: Intercepts requests to resolve logical service names via the discovery client
@LoadBalanced marks a RestTemplate so that a LoadBalancerInterceptor is applied, translating service names like http://my-service/api into real IP/port using the discovery client.
Question 26: Which programming model does Spring Cloud Gateway use for reactive, non-blocking request processing?
- Spring MVC with Tomcat thread pool
- Akka HTTP with actor model
- Spring WebFlux with Project Reactor (Correct answer)
- Netty with Vert.x event loop
Correct answer: Spring WebFlux with Project Reactor
Spring Cloud Gateway is built on Spring WebFlux and Project Reactor, providing non-blocking, reactive request routing and filtering.
Question 27: What is the purpose of the 'ignoreExceptions' property in a Resilience4j circuit breaker configuration?
- To suppress stack trace output in application logs
- To list exception types that should not be counted as failures when calculating the failure rate (Correct answer)
- To disable the circuit breaker for methods throwing certain exceptions
- To skip retry logic for specified exception types
Correct answer: To list exception types that should not be counted as failures when calculating the failure rate
ignoreExceptions specifies exception classes that the circuit breaker passes through without recording as failures, useful for expected business exceptions like NotFoundException.
Question 28: Which Spring Cloud Gateway predicate routes requests where the path matches `/api/orders/**`?
- Match=/api/orders/**
- Route=/api/orders/**
- Path=/api/orders/** (Correct answer)
- PathVariable=/api/orders/**
Correct answer: Path=/api/orders/**
The Path predicate factory in Spring Cloud Gateway routes requests whose URI path matches the specified Ant-style pattern.
Question 29: What is the function of the `CircuitBreakerGatewayFilter` in Spring Cloud Gateway?
- It blocks traffic when the gateway CPU exceeds 90%
- It monitors gateway memory and restarts when it exceeds a threshold
- It wraps downstream calls with a circuit breaker to handle failures and trigger fallbacks (Correct answer)
- It tracks error rates per route and adjusts routing weights dynamically
Correct answer: It wraps downstream calls with a circuit breaker to handle failures and trigger fallbacks
The CircuitBreakerGatewayFilter integrates a circuit breaker (e.g., Resilience4j) into the gateway routing pipeline, enabling fallback URIs when downstream services fail.
Question 30: What is the professional role of health indicators in Spring Cloud services exposed via Spring Actuator?
- They generate revenue reports for stakeholders
- They configure circuit breaker thresholds automatically
- They report service and dependency health to orchestration platforms for routing and restart decisions (Correct answer)
- They replace unit tests for service correctness
Correct answer: They report service and dependency health to orchestration platforms for routing and restart decisions
Health indicators expose service readiness and liveness, allowing platforms like Kubernetes or Eureka to make informed decisions about routing traffic and restarting unhealthy instances.
Question 31: What does a `fallback` in Spring Cloud CircuitBreaker provide?
- A read replica for database queries when the primary is overloaded
- A secondary Config Server when the primary is unavailable
- An alternative load balancing strategy when the primary fails
- A backup response or method executed when the circuit is open or a call fails (Correct answer)
Correct answer: A backup response or method executed when the circuit is open or a call fails
A fallback is a function or method that returns a default or cached response when the circuit breaker is open or the protected call throws an exception.
Question 32: Which Resilience4j pattern limits the number of concurrent calls to a service to isolate failures and prevent resource exhaustion?
- Retry
- Circuit Breaker
- Rate Limiter
- Bulkhead (Correct answer)
Correct answer: Bulkhead
The Bulkhead pattern limits concurrent calls to a service, isolating it so a spike of slow calls cannot exhaust shared resources and affect other services.
Question 33: How does Resilience4j support sharing a base configuration across multiple circuit breaker instances?
- By extending a parent Spring bean definition
- By defining a 'default' configuration that other instances inherit via the baseConfig property (Correct answer)
- By using separate Spring profiles per circuit breaker instance
- By importing a shared YAML anchor into each instance block
Correct answer: By defining a 'default' configuration that other instances inherit via the baseConfig property
Resilience4j supports a 'default' configuration entry; other instances reference it with baseConfig: default to inherit its settings and override only specific properties.
Question 34: Which library replaced Hystrix as the recommended circuit breaker in Spring Cloud after Netflix put Hystrix in maintenance mode?
- Envoy
- Sentinel
- Istio
- Resilience4j (Correct answer)
Correct answer: Resilience4j
Resilience4j became the recommended circuit breaker library in Spring Cloud after Netflix officially put Hystrix into maintenance mode.
Question 35: Which Spring Cloud component helps enforce audit logging for compliance with regulations like SOX and PCI-DSS?
- Spring Data JPA Auditing with Spring Cloud Bus events (Correct answer)
- Spring Cloud Sleuth
- Spring Cloud Config
- Spring Cloud Audit
Correct answer: Spring Data JPA Auditing with Spring Cloud Bus events
Spring Data JPA Auditing combined with Spring Cloud Bus events enables distributed audit trails required by SOX and PCI-DSS.
Question 36: Which Resilience4j configuration property defines how long the circuit remains in Open state before transitioning to Half-Open?
- waitDurationInOpenState (Correct answer)
- breakerResetTime
- recoveryDelay
- openCircuitTimeout
Correct answer: waitDurationInOpenState
waitDurationInOpenState sets the duration the circuit breaker remains in Open state before switching to Half-Open to test recovery.
Question 37: How does Spring Cloud Kubernetes perform service discovery within a Kubernetes cluster?
- It uses DNS-SD records published by CoreDNS
- It queries the Kubernetes API server for Services and Endpoints (Correct answer)
- It deploys its own Eureka server inside the cluster
- It reads environment variables injected by the kubelet
Correct answer: It queries the Kubernetes API server for Services and Endpoints
Spring Cloud Kubernetes uses the Kubernetes API server to discover services and their endpoints, enabling native Kubernetes-based service discovery.
Question 38: Which Spring Cloud pattern addresses the ISO 27001 requirement for business continuity by ensuring service availability during partial infrastructure failures?
- Spring Cloud Config high availability mode
- Spring Cloud Contract consumer-driven tests
- Spring Cloud Sleuth sampling rate adjustment
- Spring Cloud CircuitBreaker with Bulkhead pattern for resource isolation (Correct answer)
Correct answer: Spring Cloud CircuitBreaker with Bulkhead pattern for resource isolation
The Bulkhead pattern isolates resources so failures in one service don't cascade, maintaining business continuity as required by ISO 27001 availability controls.
Question 39: Which Spring Cloud starter dependency integrates Resilience4j as the circuit breaker implementation for Spring Boot 3 projects?
- spring-cloud-resilience4j-starter
- spring-cloud-starter-circuitbreaker-resilience4j (Correct answer)
- spring-boot-starter-resilience4j
- resilience4j-spring-cloud
Correct answer: spring-cloud-starter-circuitbreaker-resilience4j
The spring-cloud-starter-circuitbreaker-resilience4j dependency provides Spring Cloud's Circuit Breaker abstraction backed by Resilience4j.
Question 40: Stakeholders want traceability across microservices for debugging. What does Spring Cloud Sleuth add to log messages to support this requirement?
- Trace IDs and span IDs (Correct answer)
- User session IDs and HTTP headers
- Service version and build numbers
- Database transaction IDs
Correct answer: Trace IDs and span IDs
Spring Cloud Sleuth injects trace IDs (for the overall request) and span IDs (for individual service calls) into logs to enable distributed tracing.
Question 41: Which actuator endpoint exposes the current state and metrics of all Resilience4j circuit breakers in a Spring Boot application?
- /actuator/resilience
- /actuator/health/circuit
- /actuator/circuitbreakers (Correct answer)
- /actuator/breakers
Correct answer: /actuator/circuitbreakers
The /actuator/circuitbreakers endpoint, provided by resilience4j-spring-boot2/3, exposes real-time state and call statistics for all configured circuit breakers.
Question 42: Which property disables Eureka registration for a Spring Boot service during local development?
- spring.cloud.discovery.enabled=false
- eureka.client.register-with-eureka=false (Correct answer)
- eureka.server.enabled=false
- eureka.client.fetch-registry=false
Correct answer: eureka.client.register-with-eureka=false
Setting eureka.client.register-with-eureka=false prevents the service from registering itself with the Eureka server.
Question 43: How does Spring Cloud Gateway integrate with service discovery to route requests to registered services by name?
- By hardcoding service IPs in route configuration
- Through a sidecar proxy that intercepts all traffic
- By querying the DNS server for service IP resolution
- Via the lb:// URI scheme which triggers client-side load balancing through DiscoveryClient (Correct answer)
Correct answer: Via the lb:// URI scheme which triggers client-side load balancing through DiscoveryClient
Using lb://service-name as the route URI instructs Spring Cloud Gateway to use the load balancer and service discovery to resolve the target service's instances.
Question 44: Which Spring Cloud circuit breaker implementation is based on Resilience4j?
- Spring Cloud Retry
- Spring Cloud Hystrix
- Spring Cloud Fault Tolerance
- Spring Cloud CircuitBreaker with Resilience4j (Correct answer)
Correct answer: Spring Cloud CircuitBreaker with Resilience4j
Spring Cloud CircuitBreaker provides an abstraction with a Resilience4j implementation, replacing the deprecated Netflix Hystrix circuit breaker.
Question 45: What Spring Cloud annotation enables a WebClient bean for load-balanced service calls?
- @LoadBalanced applied to a WebClient.Builder bean (Correct answer)
- @BalancedWebClient on the injection point
- @EnableWebClientLoadBalancing on the main class
- @ReactiveLoadBalanced applied to the WebClient bean
Correct answer: @LoadBalanced applied to a WebClient.Builder bean
Applying @LoadBalanced to a WebClient.Builder @Bean method instructs Spring Cloud LoadBalancer to intercept calls and resolve service names to actual instances.
Question 46: What is the purpose of the 'permittedNumberOfCallsInHalfOpenState' property in Resilience4j?
- It defines how many probe calls are allowed through when the circuit is testing recovery in Half-Open state (Correct answer)
- It sets the maximum thread count during service recovery
- It limits request concurrency while the circuit initializes
- It controls the number of retry attempts in degraded mode
Correct answer: It defines how many probe calls are allowed through when the circuit is testing recovery in Half-Open state
permittedNumberOfCallsInHalfOpenState controls how many test requests are sent through in Half-Open state to determine if the downstream service has recovered.
Question 47: When both @Retry and @CircuitBreaker are applied to the same method in Resilience4j, what is the default execution order?
- CircuitBreaker wraps Retry, so the circuit is checked before retrying
- Only the outermost annotation takes effect
- Both execute simultaneously in separate threads
- Retry wraps CircuitBreaker, so retries happen before the circuit counts a failure (Correct answer)
Correct answer: Retry wraps CircuitBreaker, so retries happen before the circuit counts a failure
By default, Retry is the outer decorator and CircuitBreaker is inner, so retries execute before the circuit breaker records an overall failure for that call.
Question 48: What does the 'slidingWindowSize' property control in a Resilience4j circuit breaker configuration?
- The maximum size of the thread pool
- The number of recent calls analyzed to calculate the failure rate (Correct answer)
- The timeout duration for each individual request
- The interval between retry attempts
Correct answer: The number of recent calls analyzed to calculate the failure rate
slidingWindowSize defines how many recent calls (COUNT_BASED) or seconds (TIME_BASED) are used to calculate the failure rate for circuit breaker decisions.
Question 49: In Resilience4j, what is the difference between a Retry and a Circuit Breaker when used together in Spring Cloud?
- Retry retries individual calls; Circuit Breaker stops calls after a threshold of failures (Correct answer)
- Retry only works with synchronous calls; Circuit Breaker works with reactive
- They are interchangeable and serve the same purpose
- Circuit Breaker retries calls; Retry tracks failure counts
Correct answer: Retry retries individual calls; Circuit Breaker stops calls after a threshold of failures
Retry automatically re-attempts a failed call a configured number of times, while Circuit Breaker opens and short-circuits calls entirely after failure thresholds are exceeded.
Question 50: Which interface must be implemented to create a custom Spring Cloud ServiceRegistry?
- org.springframework.cloud.client.serviceregistry.ServiceRegistry (Correct answer)
- org.springframework.cloud.loadbalancer.core.ReactorServiceInstanceLoadBalancer
- org.springframework.cloud.client.ServiceInstance
- org.springframework.cloud.discovery.DiscoveryClient
Correct answer: org.springframework.cloud.client.serviceregistry.ServiceRegistry
The ServiceRegistry interface in Spring Cloud provides the contract for registering and deregistering service instances with a registry.
Question 51: HIPAA requires a covered entity to have a Business Associate Agreement (BAA). How does this impact Spring Cloud third-party service integrations?
- Any third-party service receiving PHI via Feign clients or Spring Cloud Stream must have a BAA in place (Correct answer)
- OAuth2 tokens must use HIPAA-approved algorithms
- Spring Cloud Config must encrypt all properties
- All Spring Cloud starter dependencies must be HIPAA-certified
Correct answer: Any third-party service receiving PHI via Feign clients or Spring Cloud Stream must have a BAA in place
Any external service that receives PHI through microservice calls — whether via Feign, Stream, or Gateway — must have a signed BAA with the covered entity.
Question 52: A case study on Spring Cloud Gateway rate limiting with Redis reveals over-limiting spikes during Redis leader election. What is the most resilient evidence-based remediation?
- Switch to an in-memory token bucket that resets on pod restart
- Add a second Redis instance and round-robin requests between them
- Disable rate limiting during off-peak hours
- Use Redis Cluster with Sentinel and implement a fail-open fallback that allows requests when Redis is unavailable (Correct answer)
Correct answer: Use Redis Cluster with Sentinel and implement a fail-open fallback that allows requests when Redis is unavailable
Redis Cluster with Sentinel improves availability, and a fail-open policy during Redis downtime prevents legitimate traffic from being blocked by infrastructure events.
Question 53: Which Spring Cloud annotation registers a service with any available discovery server (Eureka, Consul, etc.) in a provider-agnostic way?
- @EnableCloudRegistration
- @EnableServiceMesh
- @EnableDiscoveryClient (Correct answer)
- @EnableEurekaClient
Correct answer: @EnableDiscoveryClient
@EnableDiscoveryClient is provider-agnostic and works with any Spring Cloud DiscoveryClient implementation on the classpath.
Question 54: A Spring Cloud team wants to validate that their microservices integration contracts remain consistent as code evolves. Which professional practice best addresses this?
- Deploying all services simultaneously on each release
- Running integration tests only in production
- Manual end-to-end testing before every deployment
- Consumer-driven contract testing using Spring Cloud Contract (Correct answer)
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.
Question 55: What is the purpose of a 'Filter' in Spring Cloud Gateway?
- Modifying the incoming request or outgoing response before/after routing (Correct answer)
- Selecting which downstream instance receives a request
- Caching responses from downstream services
- Discovering available routes from the service registry
Correct answer: Modifying the incoming request or outgoing response before/after routing
Filters in Spring Cloud Gateway can inspect and modify HTTP requests and responses, enabling cross-cutting concerns like authentication, logging, and header manipulation.
Question 56: What is the default load balancing algorithm used by Spring Cloud LoadBalancer?
- Round-robin (Correct answer)
- Least connections
- Weighted round-robin
- Random selection
Correct answer: Round-robin
Spring Cloud LoadBalancer uses round-robin as its default algorithm, cycling through available service instances in order.
Question 57: What replaces the deprecated Netflix Zuul as the recommended API gateway in Spring Cloud?
- Spring Cloud Consul Gateway
- Spring Cloud Router
- Spring Cloud Proxy
- Spring Cloud Gateway (Correct answer)
Correct answer: Spring Cloud Gateway
Spring Cloud Gateway, built on Spring WebFlux and Project Reactor, is the modern replacement for the deprecated Netflix Zuul API gateway.
Question 58: What does the @RateLimiter annotation control when applied to a method in Resilience4j?
- The CPU utilization threshold per service instance
- The network bandwidth consumed per request
- The speed of database read operations
- The number of calls allowed within a configured time window (Correct answer)
Correct answer: The number of calls allowed within a configured time window
@RateLimiter restricts how many calls can be made to the annotated method within a defined time period, preventing downstream overload.
Question 59: Which Spring Cloud LoadBalancer feature caches the list of service instances to reduce calls to the discovery server?
- EurekaRegistryCache
- DiscoveryClient prefetch
- CachingServiceInstanceListSupplier (Correct answer)
- ServiceInstanceCache
Correct answer: CachingServiceInstanceListSupplier
CachingServiceInstanceListSupplier wraps another supplier and caches the returned service instances for a configurable TTL, reducing repeated discovery server lookups.
Question 60: What exactly is an aspect?
- Aspect is used to log information of application
- A module which has a set of APIs providing cross-cutting requirements (Correct answer)
- Aspect represents properties of spring based application
- Aspect is a way to do the dependency injection
Correct answer: A module which has a set of APIs providing cross-cutting requirements
An aspect in Spring AOP (Aspect-Oriented Programming) is a modular unit that encapsulates a cross-cutting concern, such as logging, security, or transaction management. It provides a set of APIs to define and apply these concerns across multiple points in an application without modifying the core business logic. This approach helps in decoupling concerns, leading to cleaner, more modular, and maintainable code.
VMware Spring Professional Develop (Spring Cloud)
Validates expertise in Spring Cloud microservices development, covering service discovery, API gateway routing, circuit breaker resilience patterns, and distributed configuration management using the Spring ecosystem.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds