CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 445
Add dubbogo adapter #60
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
Conversation
Could you please sign the CLA here: https://cla-assistant.io/alibaba/sentinel-golang?pullRequest=60 |
adapter/dubbogo/consumer_filter.go
Outdated
} | ||
|
||
func (d *consumerFilter) OnResponse(result protocol.Result, _ protocol.Invoker, _ protocol.Invocation) protocol.Result { | ||
return result |
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.
Actually, when the invocation completes (whether successful or with error), we need to call e.Exit()
to mark it as completed, or the response time, complete count and error count will be lost. We may need to carry the *SentinelEntry
in the RPC context (if possible) and handle it in OnResponse
callback.
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 check it
adapter/dubbogo/consumer_filter.go
Outdated
sentinel.WithTrafficType(base.Outbound), | ||
sentinel.WithArgs(invocation.Attachments())) | ||
if b != nil { // blocked | ||
result := &protocol.RPCResult{} |
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.
Can we also provide a fallback registry where developers could register their own fallback logic when blocked? We could provide the default behavior.
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 check it
return consumerDubboFallback(ctx, invoker, invocation, b) | ||
} | ||
} else { | ||
// TODO : Need to implement asynchronous current limiting |
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.
What're the differences between async and sync mode?
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 is mainly to see that in Java code, async entry is used instead of entry to restrict current. At this stage, Dubbo go has not added async field in attachment, so it will not come to async logic
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.
Okay. Sentinel Go has unified entry
and asyncEntry
, so we could use sentinel.Entry(args)
for both sync and async scenarios.
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
add dubbo-go adapter
Does this pull request fix one issue?
#55
Describe how you did it
Describe how to verify it
Special notes for reviews