spring cloud interview questions

Top Frequently Asked Spring Cloud Interview Questions

What is Spring Cloud ?

Spring Cloud Stream App Starters are Spring Boot based Spring Integration applications that provide integration with external systems. Spring Cloud Task. A short-lived microservices framework to quickly build applications that perform finite amounts of data processing

What is microservice ?

It is loosely coupled , distributed small service that allows to decompose large application into small , well defined manageable components.so that they are completely independent of one another

Mention few characteristics of microservice ?

  • It breaks down logic into small well defined component.
  • Each component has a small domain of responsibility.It is deployed completely independent of another microservice.
  • Microservice communicate or exchange data using lightweight protocols like HTTP and JSON.
  • As Microservice is small and independent in nature so small team can work on well-defined areas of responsibility
  • Microservice owns their data structure and data source.Database that keeps the microservice's data, can be locked down to only allow that service to access it

What is Netflix Feign ?

Feign is a java to http client binder inspired by Retrofit.

Mention few Microservice patterns ?

  • Routing Pattern
  • Core Pattern
  • Security Pattern
  • Build and deployment pattern
  • Client resiliency pattern
  • Logging and tracing patterns

What is Microservice Routing Pattern ?

In Routing Pattern ,physical address of services are kept abstract and only single point of entry for service call is provided.In Routing Pattern whenever a client application wants to consume any service then it discovers the location of service and then is routed to that service.

What is spring cloud config ?

Microservices have a lot of configuration specially related to environment. Spring cloud config handles the management of application configuration data through a centralized service.By this way all microservivces have same configuration. and configuration will be separate from microservivces.It has its own repository.

Can Spring cloud config integrates with open sources for repository like git ?

Yes

What is the use of spring cloud stream ?

Spring cloud stream allows to integrate microservices with message brokers

What is Spring cloud sleuth ?

By this we can integrate unique tracking identifiers into the HTTP calls and message channels.That helps to track a transaction as it flows across the different services in your application

What is Spring cloud security ?

It is an authentication and authorization framework that can control who can access our services and what they can do with your services.In spring cloud security microservices communicate using token.Receiving service first check token to validate caller.

Give some example where microservices are not powerful ?

  • Microservices instance are deployed in separate servers.If an application has many Microservices then we need to maintain many server and complexity will be higher.
  • If application is small then building microservices for distributed model is very complex.

Why cloud based application configuration should be centralized ?

In cloud based application , it's possible that many microservices are deployed and its really difficult to maintain separate repository for each microservice. So its good to maintain centralize repository to hold application configuration that reduces number of repository.

In which profile Spring cloud configuration server will run if filesystem is used to store configuration information ?

native

What is the annotation to make enable spring boot application for spring cloud config server ?

@EnableConfigServer

Give one example of Spring cloud config server using file system ?

Spring Cloud Config Example.

Which property we need to set to make decryption disable at server ?

spring.cloud.config.server.encrypt.enabled: false

Give one example where spring cloud encrypt and decrypt properties ?

Spring Cloud Config Example with encryption.

What is service discovery ?

In a distributed architecture , we used to find the physical address of the service where that service is deployed.This concept is called service discovery.

Why service discovery in microservice is critical ?

  • As service consumer does not know the physical address of the service instance so using service discovery application developer can horizontally scale up and down service instance running in an environment.
  • It helps to increase application resiliency because service discovery removes unavailable service instance from its list.

Mention few benefits for service discovery mechanism?

  • Availability : Service lookups is shared among all nodes of service discovery cluster.So even a node becomes unavailable then others node take over.
  • Sharing Instances : each node in cluster shares instances of services.
  • Fault tolerant : If any service instance is not healthy then service discovery removes it from its table.
  • Load balanced : Service discovery ensures that when when service invocation happens then invocation is spread across all instances.

What is client side load balancing in service discovery mechanism ?

When a service consumer wants to consume any service , he needs service location. To get service location he calls to service discovery and gets all service instances of the service which consumers wants to consume and cache it locally.

Next time again if he calls same service then he gets from local cache.We say load balancing because it uses algorithm so that every instance gets equal chance.

What annotation is required to make a service as Eureka service ?

@EnableEurekaServer

What is the significance of eureka.instance.preferIpAddress entry at service 's properties file while doing registery at Eureka service ?

By default Eureka assumes that service will be registered as hostname but by making this entry true we can inform to Eureka that service should be registered as IP address.

Mention few client library by which service consumer can interact with Ribbon ?

  • Spring Discovery client
  • Ribbon Aware Spring RestTemplate
  • Netflix Feign client

Give one example of client library by which service consumer can interact with Ribbon ?

Netflix Eureka Service Discovery Client

What is the use of client side resiliency pattern ?

It protects the client from crashing when remote resource is failing due to poor performance or error.It makes client fail fast.

Mention few client resiliency patterns ?

  • Fallback
  • Bulkhead
  • Circuit breakers
  • Client-side load balancing

What is Client-side load balancing ?

Client-side load balancing caches microservices endpoints retrieved from service discovery.

What is Fallback ?

Fallback executes any alternative flow if it exists in case remote service 's call is failing.

What is Circuit breakers ?

It stops client to call remote service if remote service is repeatedly failing.

What is Bulkheads ?

It segregates different service call on service client so that poor service does not use all resources on client.

What is service gateway ?

In distributed microservices application , cross cutting concern like logging , security are done through separate independent service and call to other service are routed through this independent service.This service is called service gateway.It acts as an intermediary between the service client and a service being invoked.

What is the use of ignored-services attribute in zuul service gateway?

By default when we do manually route mapping for service registered with Eureka then zuul exposes automatic route mapping as well.If we want to expose only manually route mapping then ignored-services attribute is used and eureka id based routes are excluded.

What type of filters are supported by Zuul ?

  • Pre filters
  • Post filters
  • Route filters



Visit Others Links

Interview Questions Top Elasticsearch Interview Question
Top Kubernetes Interview Question
Top HTTP Interview Question
Top PouchDB Interview Question
Top Pivotal Cloud Foundry (pcf) Interview Question
Top Apache Camel Interview Question
Top Docker Interview Question
Top Gradle Interview Question
Top Generics Interview Questions In Java
Java 9 Interview Questions
Top Maven Interview Question
Top RabbitMQ Interview Question
Top Spring Batch Interview Question
Top Spring Boot Interview Question
Top Tika Interview Question
Top Kotlin Interview Question
Top OpenShift Interview Question
Top Polymer Interview Question
Top WebGL Interview Question
Top Continuous Integration Interview Question
Top Spring Cloud Interview Question
Top JOGL Interview Question
Top JFreeChart Interview Question
Java MultiThreading Interview Question
Top Spring ROO Interview Question
Top Seaborn Interview Question
Top TestRail Interview Question
Top LolCode Interview Question
Top Spring Transaction Management Interview Question
Top DynamoDB Interview Question
Top PySpark Interview Question
Top SaltStack Interview Question
Top Spring AOP Interview Question
© 2019 PreparationForInterview.com