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

【WIP】Support setting class-level defaultFallback for annotation extension #1467

Closed
wants to merge 2 commits into from

Conversation

zhaoyuguang
Copy link
Collaborator

@zhaoyuguang zhaoyuguang commented May 8, 2020

Resolves #1464

我现在把获取类注解的放在最上面了

@zhaoyuguang zhaoyuguang changed the title Support setting class-level defaultFallback for annotation extension 【WIP】Support setting class-level defaultFallback for annotation extension May 8, 2020
import org.springframework.stereotype.Service;

/**
* @author Eric Zhao
*/
@Service
@SentinelResource(defaultFallback = "defaultGlobalFallback", fallbackClass = {TestServiceImpl.class})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this sample, fallbackClass is not required according to the resolution strategy.

Comment on lines +19 to +20
- `fallbackClass` The default fallback method in which class.
- supported class-level annotation (since 1.8.0), Effective when the class annotation `defaultFallback` is not empty;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate with the content above:

If you want to use method in other classes, you can set the fallbackClass with corresponding Class (Note the method in other classes must be static).

And it's effective for both fallback and defaultFallback.

@sczyh30 sczyh30 added the to-review To review label May 15, 2020
@sczyh30 sczyh30 removed the to-review To review label May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support setting class-level defaultFallback for annotation extension
2 participants