-
Notifications
You must be signed in to change notification settings - Fork 826
[JAV-406]add fallback from cache and used customized cache strategies #172
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
} | ||
|
||
@Override | ||
public void record(Invocation invocation, Response response, boolean isSuccess) { |
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's the relationship between response.isSuccessed() and the parameter isSuccess?
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.
For bizkeeper, success is based on some specific exceptions than can be customized by developers, e.g. ConnectionException or SocketException. Now if only 499 client exceptions.
http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-3.0.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> | ||
|
||
<context:component-scan base-package="io.servicecomb.bizkeeper" /> |
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.
<context:component-scan base-package="io.servicecomb" />
we already set this in core.
springmvc: | ||
codeFirst: | ||
fallbackFromCache: | ||
policy: fromcache |
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 change the policy name with the camel case just like fromCache, returnNull, throwException?
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.
OK. I change fromcache to fromCache. But others is compatible.
@ApiResponses(value = {@ApiResponse(code = 200, response = String.class, message = "xxx"), | ||
@ApiResponse(code = 490, response = String.class, message = "xxx")}) | ||
public String fallbackReturnNull(@PathVariable(name = "name") String name) { | ||
if ("throwexception".equals(name)) { |
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.
It's better to use the constant string.
|
||
@Override | ||
public String name() { | ||
return "returnnull"; |
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 use the camel case "returnNull" and the constant.
No description provided.