Skip to content
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

[API-CHANGE] Bring nouveau Sentinel entry API in Sentinel 2.0 | Sentinel 2.0 全新 API model #2845

Open
sczyh30 opened this issue Aug 24, 2022 · 4 comments
Assignees
Labels
api-change Issues or PRs related to api changes kind/discussion For further discussion kind/feature Category issues or prs related to feature request.
Milestone

Comments

@sczyh30
Copy link
Member

sczyh30 commented Aug 24, 2022

Issue Description

Type: feature request

Describe what happened (or what feature you want)

There are some drawbacks to legacy Sentinel API model:

  • Strategies during invocation (e.g. timeout cut-down, retry, bulkhead isolation) cannot be carried out due to the restriction of the API model (for the lack of "managed" model).
  • Lacking capabilities of traffic scheduling (i.e. routing and load balancing).

image

So we'd like to propose a nouveau Sentinel entry API in Sentinel 2.0.

image

An example of "managed" model:

try {
  // f (() -> R): your actual logic, wrapped with lamada
  // fallbackSupplier (() -> R): generates the fallback object when fails
  R result = Sentinel.execute(resourceName, f, fallbackSupplier, args);
} catch (BlockException e) {
  // your block handler here
}

An example of "outside-wrapped" model (like legacy entry):

try (Sentinel.entry(resourceName)) {
  // your logic here
} catch (BlockException e) {
  // your block handler here
}

NOTE: The legacy SphU and SphO API will not be deprecated, but we'll recommend using the new API for Sentinel 2.0.

@sczyh30 sczyh30 added kind/feature Category issues or prs related to feature request. api-change Issues or PRs related to api changes labels Aug 24, 2022
@sczyh30 sczyh30 added this to the 2.0.0 milestone Aug 24, 2022
@liaomengge
Copy link

Sentinel 2.0相比1.8.x会有很大的变更吗? 可以将开源的2.0版本直接merge到二开的版本上(基于1.8.x)吗?

@sczyh30
Copy link
Member Author

sczyh30 commented Aug 25, 2022

There will be breaking changes in Sentinel 2.0, but we'll try to keep compatibility with Sentinel 1.8.x.

@liaomengge
Copy link

是所有api都发生了很大的变化嘛? 还是只是部分使用上的改变? 是类似nacos 1.x到2.x的大变更升级?还是只是增加部分功能以及部分Api名称的变化?

@sczyh30 sczyh30 added the kind/discussion For further discussion label Nov 19, 2022
@sczyh30 sczyh30 self-assigned this Nov 19, 2022
@sczyh30 sczyh30 changed the title [API-CHANGE] Bring nouveau Sentinel entry API in Sentinel 2.0 [API-CHANGE] Bring nouveau Sentinel entry API in Sentinel 2.0 | Sentinel 2.0 全新 API model Nov 19, 2022
@HanYi001
Copy link

希望可以更方便的和配置中心联动,有部分需要修改源码才能和nacos配置中心联动

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Issues or PRs related to api changes kind/discussion For further discussion kind/feature Category issues or prs related to feature request.
Projects
None yet
Development

No branches or pull requests

3 participants