apache / apache/dubbo

[Proposal]Embedded Short-Circuit support

Open
#2,037 2 comments 0 reactions 1 assignee Claimed by @aamingaa View on GitHub
type/proposal
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

Hello, community

I am writing to introduce a proposal of supporting short-circuit in Dubbo. This is a feature that the community desperately needs.

Some discussions about this feature recently:

https://github.com/apache/incubator-dubbo/pull/1574
https://github.com/apache/incubator-dubbo/issues/1505
https://lists.apache.org/thread.html/59b8feb5b6c379e9aa081c1a2a39171f10108d4a79901320de2310d8@%3Cdev.dubbo.apache.org%3E

### Hystrix

Hystrix provides a quite easy way for developers by wrapping Dubbo RPC calls, and it can be more flexible by using directly, so I think there's no need of integrating ystrix with Dubbo internally. Besides, the Dubbo team has provided [a demo of using Hystrix with Dubbo](https://github.com/dubbo/dubbo-samples/tree/master/dubbo-samples-spring-hystrix).

### Embedded Short-Circuit support

Dubbo has a fallback mechanism, known as [mock](http://dubbo.apache.org/#/docs/user/demos/local-mock.md?lang=en-us), but it's not intelligent enough, it will always start a remote call and default to fallback only when this call fails. To make it more intelligent, we can add a decision maker, called Circuit Breaker, based on the statistics collected. The state of the Circuit Breaker changes continuously, so it can be used to decide whether to make an actual remote call or return directly with the fallback value when a request comes.

@ralf0131 has submitted a PR #1966 introducing a totally new Metrics module, I think this module can be used as the basis of the upcoming Circuit Breaker.

Below is the extensions I think we should add:

- One new LoadBalance policy that can distribute traffic according to downstream node healthy status.
- One new Cluster policy works as an intelligent mock based on the Circuit Breaker.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.