-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support traffic routing capability. #3024
Conversation
sentinel-core/src/main/java/com/alibaba/csp/sentinel/traffic/LoadBalance.java
Outdated
Show resolved
Hide resolved
sentinel-core/src/main/java/com/alibaba/csp/sentinel/traffic/RouterFilter.java
Outdated
Show resolved
Hide resolved
/** | ||
* @author panxiaojun233 | ||
*/ | ||
public class Instance { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a toString()
for entities?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I will fix it
public class Route { | ||
private String name; | ||
private List<StringMatch> services; | ||
private List<RouteDetail> routedetail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camel case: routeDetail
is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I will fix it
|
||
@Override | ||
public String toString() { | ||
return "DubboRoute{" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please re-generate toString()
for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.alibaba.csp.sentinel.traffic.rule.vritual.workload; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: vritual
-> virtual
How about just com.alibaba.csp.sentinel.traffic.rule.workload
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
private StringMatch path; | ||
private Integer argc; | ||
private List<ArgumentMatch> args; | ||
private List<StringMatch> argp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems perplexing... Maybe we could improve the naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
* The subscriber of traffic rule. | ||
* @author panxiaojun233 | ||
*/ | ||
public interface TrafficRuleSubscriber { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we actually observes the event of "remote provider app change", not the rule. So maybe RemoteAppObserver
or other name is better?
The same for subscribe
/unsubscribe
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
c82a4ba
to
ae09653
Compare
a265fad
to
19ecab4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Nice work. Thanks for contributing! |
Describe what this PR does / why we need it
Support traffic routing capability based on OpenSergo TrafficRouter
Does this pull request fix one issue?
Fixes #3023
Describe how you did it
Refer the design notes in #3023
Describe how to verify it
Run the test cases and demo.
A relevant Dubbo extension that integrates with the traffic router: apache/dubbo-spi-extensions#192
Special notes for reviews
IMPORTANT: we may need to discuss the module and package structure of the nouveau traffic routing code. See #3025