Spring Boot Microservices: Mastering Service Discovery and Load Balancing
Assess your understanding of service discovery and load balancing in Spring Boot microservices.
Questions in this quiz
12 questions on Spring Boot Microservices: Mastering Service Discovery and Load Balancing. Work through them here, then start the quiz to answer them and see your score.
1.What is the primary role of a service registry in a microservices architecture?
- ATo handle HTTP requests
- BTo manage database connections
- CTo keep track of available microservices and their instances
- DTo store user credentials securely
2.Which Spring Cloud component is commonly used for service discovery?
- ASpring Cloud Stream
- BSpring Cloud Gateway
- CSpring Cloud Config
- DEureka
3.In a Spring Boot application, how do you enable a service to register with Eureka?
- AAdd @EnableDiscoveryClient annotation
- BAdd @EnableCircuitBreaker annotation
- CAdd @EnableEurekaClient annotation
- DAdd @EnableConfigServer annotation
4.What is the default load balancing strategy used by Spring Cloud Netflix Ribbon?
- ALeast connections
- BRandom
- CWeighted response time
- DRound-robin
5.Which property is used to configure the Eureka server URL in a Spring Boot application?
- Aeureka.client.serviceUrl.defaultZone
- Beureka.server.url
- Cspring.cloud.eureka.url
- Deureka.client.serverUrl
6.What is the purpose of the @LoadBalanced annotation in Spring Boot?
- ATo secure HTTP endpoints
- BTo configure a database connection pool
- CTo manage application caching
- DTo enable load balancing for RestTemplate
7.Which of the following is NOT a benefit of using service discovery in microservices?
- AAutomatic service registration
- BImproved fault tolerance
- CDynamic scaling of services
- DCentralized logging
8.How does Eureka handle service instance failures?
- AIt automatically restarts the failed instance
- BIt sends an alert to the administrator
- CIt logs the failure and continues to route traffic
- DIt removes the instance from the registry after a timeout
9.Which configuration file is typically used to set up Eureka client properties in a Spring Boot application?
- Adiscovery.yml
- Bapplication.properties
- Ceureka.properties
- Dbootstrap.yml
10.What is the role of the Eureka server in a microservices architecture?
- ATo provide a centralized configuration management
- BTo manage distributed transactions
- CTo act as a service registry
- DTo act as a load balancer
11.Which of the following is a key advantage of client-side load balancing?
- ACentralized control of traffic
- BReduced network latency
- CSimplified server configuration
- DIncreased server resource utilization
12.What happens if a Eureka client cannot reach the Eureka server during startup?
- AThe client fails to start
- BThe client starts in a fallback mode using cached data
- CThe client switches to a backup server
- DThe client logs an error and retries indefinitely