- Explain Spring cloud? or, What is Spring Cloud? …
- What are the common features of Spring cloud? …
- Explain load balancing? or What is load balancing? …
- How load balancing is implemented in the Spring cloud? …
- What is the meaning of Service registration and discovery?
Top 25 Microservice Interview Questions Answered – Java Brains
18. Can we override or replace the Embedded tomcat server in Spring Boot?
Yes, we can replace the Embedded Tomcat server with any server by using the Starter dependency in the pom.xml file. Like you can use spring-boot-starter-jetty as a dependency for using a jetty server in your project.
Which design pattern are used in Microservices ?
11. What is Spring Boot CLI and what are its benefits?
Spring Boot CLI is a command-line interface that allows you to create a spring-based java application using Groovy.
Example: You don’t need to create getter and setter method or access modifier, return statement. If you use the JDBC template, it automatically loads for you.
27. How to enable Actuator in Spring boot application?
To enable the spring actuator feature, we need to add the dependency of “spring-boot-starter-actuator” in pom.xml.
What are the different kinds of filters provided by Zuul?
Zuul provides the following filter types that correspond to the lifecycle of a request.
1. PRE Filters – Filters that execute before routing to the origin server.
2.ROUTING Filters – Filters that handle routing the request to an origin. Builds HTTP Request and calls the Origin server using Apache HttpClient or Netflix Ribbon.
3. POST Filters – Filters that execute after the request has been routed to the origin.
4. ERROR Filters – Filters that execute when an error occurs during any one of the phases.
Following are some frequently asked questions in Spring Cloud Open Serevice Broker
19. Can we disable the default web server in the Spring boot application?
Yes, we can use application.properties to configure the web application type i.e spring.main.web-application-type=none.
What is Spring Cloud Ribbon? One can scale microservice architecture application in both vertical i.e. by increasing the allocation of heap memory as well as horizontal i.e. by making more then one instances available of same service. Horizontal scaling is done by the help of Load Balancers.
In this example, we will be implementing Netflix Ribbon in a spring boot application. We will be calling instance of demo application multiple times(here 3 times), and then with the help of LoadBalancer Application, the process of Load Balancing will be done and multiple instances will be managed. The algorithm uses by Netflix Ribbon for load balancing is Round Robin algorithm.
16. Is it possible to change the port of the embedded Tomcat server in Spring Boot?
Yes, it is possible. By using the server.port in the application.properties.
Spring Boot Interview Questions For Freshers
The advantages of Spring Boot are listed below: