dubbo interview questions

1. Why Dubbo?

With the further development of the service, more and more service calls and dependencies between services are increasingly complex, the birth of a service-oriented system architecture (SOA), and thus spawned a series of relevant technologies, as for service provision, service call connection processing, the communication protocol, serialization, service discovery, service routing, and other behavior log output frame package of services. So governance framework for the service distributed systems appeared, Dubbo so it produces.

2. Service calls are blocked it?

The default is blocked, can be called asynchronously, there is no return value can do. Dubbo is NIO non-blocking calls for parallel, multi-threaded client does not need to start to complete the parallel invoke multiple remote services, the smaller the relative cost of multi-threaded, asynchronous call returns a Future object-based.

3. What is the general use of the registry? There are other options?

Zookeeper is recommended as a registration center, there Redis, Multicast, Simple registration center, but not recommended.

4.Dubbo recommend any agreement with?

  • dubbo: // (recommended)
  • rmi://
  • hessian://
  • http://
  • webservice://
  • thrift://
  • memcached://
  • repeat: //
  • rest://

 

5. draw a picture service registration with the flow chart found?

 

Fourteen asked Dubbo cut to the heart, in order to determine the wild brush strokes spring this interview Collection

 

There are several fault-tolerant cluster 6.Dubbo program?

 

Fourteen asked Dubbo cut to the heart, in order to determine the wild brush strokes spring this interview Collection

 

 

Fourteen asked Dubbo cut to the heart, in order to determine the wild brush strokes spring this interview Collection

 

7.Dubbo service degradation, failure retry how to do?

 

By dubbo: reference setting mock = "return null". Mock value may be modified to true, then talk to the interface under the same path to achieve a Mock class naming rule is "the interface name + Mock" suffix. Then implement your own logic in the relegation Mock class

How 8.Dubbo configuration file is loaded into the Spring?

Spring 容器在启动的时候,会读取到 Spring 默认的一些 schema 以及 Dubbo 自定义的 schema,每个 schema 都会对应一个自己的 NamespaceHandler,NamespaceHandler 里面通过 BeanDefinitionParser 来解析配置信息并转化为需要加载的 bean 对象!

 

9.Dubbo SPI 和 Java SPI 区别?

 

JDK SPI

JDK 标准的 SPI 会一次性加载所有的扩展实现,如果有的扩展吃实话很耗时,但也没用上,很浪费资源。所以只希望加载某个的实现,就不现实了

DUBBO SPI

1,对 Dubbo 进行扩展,不需要改动 Dubbo 的源码

2,延迟加载,可以一次只加载自己想要加载的扩展实现。

3,增加了对扩展点 IOC 和 AOP 的支持,一个扩展点可以直接 setter 注入其它扩展点。

4,Dubbo 的扩展机制能很好的支持第三方 IoC 容器,默认支持 Spring Bean。

10.Dubbo 支持服务降级吗?

以通过 dubbo:reference 中设置 mock="return null"。mock 的值也可以修改为 true,然后再跟接口同一个路径下实现一个 Mock 类,命名规则是 “接口名称+Mock” 后缀。然后在 Mock 类里实现自己的降级逻辑

11.Dubbo 如何优雅停机?

 

Dubbo 是通过 JDK 的 ShutdownHook 来完成优雅停机的,所以如果使用kill -9 PID 等强制关闭指令,是不会执行优雅停机的,只有通过 kill PID 时,才会执行。

12.Dubbo 和 Spring Cloud 的区别?

根据微服务架构在各方面的要素,看看 Spring Cloud 和 Dubbo 都提供了哪些支持

 

Fourteen asked Dubbo cut to the heart, in order to determine the wild brush strokes spring this interview Collection

 

Dubbo built using micro Services Architecture is like assembling computers, various aspects of our freedom of choice is high, but the end result is likely because the quality is not just a memory point does not shine, and people are always very assured, but if you is a master, and that these are not the problem; and Spring Cloud like a brand, in the integration of Spring Source, a lot of compatibility testing to ensure the stability of the machine has a higher, but if you want to use non something outside of the original components, you need to have sufficient understanding of its foundation.

13.Dubbo can cache the results?

In order to improve the speed of data access. Dubbo provides declarative cache, adding cache to reduce the user's workload <dubbo: reference cache = "true" /> in fact, than the average profiles on more than one label cache = "true"

What 14.Dubbo telnet command do?

After dubbo service release, we can use the telnet command to debug, management. Dubbo2.0.5 above services provide port supports telnet command

Connection services

telnet localhost 20880 // Type Dubbo enter into command mode.

View the list of services

dubbo>ls

com.test.TestService

dubbo>ls com.test.TestService

create

delete

query

 

  • ls (list services and methods)
  • ls: displays the list of services.
  • ls -l: displays the list of services for more information.
  • ls XxxService: displays a list of methods and services.

Guess you like

Origin www.cnblogs.com/fengli9998/p/12101271.html