This commit is contained in:
redkale
2024-01-20 23:07:12 +08:00
parent 436853dd03
commit 470e636e55
6 changed files with 19 additions and 17 deletions

View File

@@ -11,8 +11,8 @@
| --- | --- | --- |
|key|未定义|缓存的key支持参数动态组合比如"key_#{id}"|
|hash|```DEFAULT_HASH```|缓存的hash, 不能含有':'、'#'、'@'字符|
|localExpire|-1|本地缓存过期时长, 0表示永不过期 -1表示不作本地缓存。 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为30 <br> &emsp;${env.cache.expires}: 读取系统配置项 <br> &emsp;#delays: 读取宿主对象的delays字段值作为值<br> &emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 |
|remoteExpire|-1|远程缓存过期时长, 0表示永不过期 -1表示不作远程缓存。 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为30 <br> &emsp;${env.cache.expires}: 读取系统配置项 <br> &emsp;#delays: 读取宿主对象的delays字段值作为值<br> &emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 |
|localExpire|-1|本地缓存过期时长, 0表示永不过期 -1表示不作本地缓存。 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为300 <br> &emsp;${env.cache.expires}: 读取系统配置项 <br> &emsp;#delays: 读取宿主对象的delays字段值作为值<br> &emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 |
|remoteExpire|-1|远程缓存过期时长, 0表示永不过期 -1表示不作远程缓存。 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为300 <br> &emsp;${env.cache.expires}: 读取系统配置项 <br> &emsp;#delays: 读取宿主对象的delays字段值作为值<br> &emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 |
|nullable|false|是否可以缓存null值|
|timeUnit|```TimeUnit.SECONDS```|时间单位TimeUnit|
|comment|未定义|备注描述|

View File

@@ -7,9 +7,9 @@
|name|未定义|名称, 可用于第三方实现的定时任务组件的key, 比如xxl-job的任务标识|
|cron|未定义|cron表达式也可以使用常量值: <br> &emsp;@yearly、@annually、@monthly、@weekly、<br> &emsp;@daily、@midnight、@hourly、@minutely <br> &emsp;@1m、@2m、@3m、@5m、@10m、@15m、@30m <br> &emsp;@1h、@2h、@3h、@6h <br> &emsp;${env.scheduling.cron}: 读取系统配置项|
|zone|未定义|时区,```cron```有值才有效, 例如: "Asia/Shanghai"|
|fixedDelay|-1|延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为30 <br> &emsp;${env.scheduling.fixedDelay}: 读取系统配置项 <br> &emsp;#delays: 读取宿主对象的delays字段值作为值, <br> &emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleWithFixedDelay |
|fixedRate|-1|周期时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为30 <br> &emsp;${env.scheduling.fixedRate}: 读取系统配置项 <br> &emsp;#intervals: 读取宿主对象的intervals字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleAtFixedRate |
|initialDelay|-1|起始延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为30 <br> &emsp;${env.scheduling.initialDelay}: 读取系统配置项 <br> &emsp;#inits: 读取宿主对象的inits字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;字段类型必须是int、long数值类型 <br> 值大于0且fixedRate和fixedDelay小于0则使用 ScheduledThreadPoolExecutor.schedule |
|fixedDelay|-1|延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为300 <br> &emsp;${env.scheduling.fixedDelay}: 读取系统配置项 <br> &emsp;#delays: 读取宿主对象的delays字段值作为值, <br> &emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleWithFixedDelay |
|fixedRate|-1|周期时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为300 <br> &emsp;${env.scheduling.fixedRate}: 读取系统配置项 <br> &emsp;#intervals: 读取宿主对象的intervals字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleAtFixedRate |
|initialDelay|-1|起始延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> &emsp;100: 设置数值 <br> &emsp;5*60: 乘法表达式值为300 <br> &emsp;${env.scheduling.initialDelay}: 读取系统配置项 <br> &emsp;#inits: 读取宿主对象的inits字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;字段类型必须是int、long数值类型 <br> 值大于0且fixedRate和fixedDelay小于0则使用 ScheduledThreadPoolExecutor.schedule |
|timeUnit|```TimeUnit.SECONDS```|时间单位TimeUnit|
|comment|未定义|备注描述|
|mode|```LoadMode.LOCAL```|作用于Service模式默认值为LOCAL<br> LOCAL: 表示远程模式的Service对象中的定时任务不起作用|

View File

@@ -44,7 +44,7 @@ public @interface Cached {
* 本地缓存过期时长, 0表示永不过期 -1表示不作本地缓存。<br>
* 参数值支持方式:<br>
* 100: 设置数值
* 5*60: 乘法表达式值为30
* 5*60: 乘法表达式值为300
* ${env.cache.expires}: 读取系统配置项
* #delays: 读取宿主对象的delays字段值作为值字段类型必须是int、long数值类型
*
@@ -56,7 +56,7 @@ public @interface Cached {
* 远程缓存过期时长, 0表示永不过期 -1表示不作远程缓存。<br>
* 参数值支持方式:<br>
* 100: 设置数值
* 5*60: 乘法表达式值为30
* 5*60: 乘法表达式值为300
* ${env.cache.expires}: 读取系统配置项
* #delays: 读取宿主对象的delays字段值作为值字段类型必须是int、long数值类型
*

View File

@@ -79,8 +79,7 @@ public class HttpClusterRpcClient extends HttpRpcClient {
private CompletableFuture<HttpResult<byte[]>> httpAsync(boolean produce, Serializable userid, HttpSimpleRequest req) {
req.setTraceid(Traces.computeIfAbsent(req.getTraceid(), Traces.currentTraceid()));
String module = req.getPath();
module = module.substring(1); //去掉/
module = module.substring(0, module.indexOf('/'));
module = module.substring(1, module.indexOf('/', 1));
HttpHeaders headers = req.getHeaders();
String resname = req.getHeader(Rest.REST_HEADER_RESNAME, "");
final String localModule = module;

View File

@@ -233,7 +233,7 @@ public class HttpRequest extends Request<HttpContext> {
return this;
}
public HttpSimpleRequest createSimpleRequest(String prefixPath) {
public HttpSimpleRequest createSimpleRequest(String contextPath) {
HttpSimpleRequest req = new HttpSimpleRequest();
req.setBody(array.length() == 0 ? null : array.getBytes());
if (!getHeaders().isEmpty()) {
@@ -241,6 +241,9 @@ public class HttpRequest extends Request<HttpContext> {
if (headers.contains(Rest.REST_HEADER_RPC)) { //外部request不能包含RPC的header信息
req.removeHeader(Rest.REST_HEADER_RPC);
}
if (headers.contains(Rest.REST_HEADER_RESNAME)) { //外部request不能包含RPC的header信息
req.removeHeader(Rest.REST_HEADER_RESNAME);
}
if (headers.contains(Rest.REST_HEADER_CURRUSERID)) { //外部request不能包含RPC的header信息
req.removeHeader(Rest.REST_HEADER_CURRUSERID);
}
@@ -250,11 +253,11 @@ public class HttpRequest extends Request<HttpContext> {
req.setRemoteAddr(getRemoteAddr());
req.setLocale(getLocale());
req.setContentType(getContentType());
req.setContextPath(prefixPath);
req.setContextPath(contextPath);
req.setMethod(this.method);
String path0 = this.requestPath;
if (isNotEmpty(prefixPath) && path0.startsWith(prefixPath)) {
path0 = path0.substring(prefixPath.length());
if (isNotEmpty(contextPath) && path0.startsWith(contextPath)) {
path0 = path0.substring(contextPath.length());
}
req.setPath(path0);
req.setSessionid(getSessionid(false));
@@ -353,7 +356,7 @@ public class HttpRequest extends Request<HttpContext> {
this.keepAlive = false; //文件上传必须设置keepAlive为false因为文件过大时用户不一定会skip掉多余的数据
}
//completed=true时ProtocolCodec会继续读下一个request
this.completed = !this.boundary && !maybews && this.headerParsed;
this.completed = !this.boundary && !maybews && this.headerParsed;
this.readState = READ_STATE_BODY;
}
if (this.readState == READ_STATE_BODY) {

View File

@@ -51,7 +51,7 @@ public @interface Scheduled {
* 延迟时间,支持参数配置、乘法表达式和对象字段值 <br>
* 参数值支持方式:<br>
* 100: 设置数值
* 5*60: 乘法表达式值为30
* 5*60: 乘法表达式值为300
* ${env.scheduling.fixedDelay}: 读取系统配置项
* #delays: 读取宿主对象的delays字段值作为值字段类型必须是int、long数值类型
*
@@ -65,7 +65,7 @@ public @interface Scheduled {
* 周期时间,支持参数配置、乘法表达式和对象字段值 <br>
* 参数值支持方式:<br>
* 100: 设置数值
* 5*60: 乘法表达式值为30
* 5*60: 乘法表达式值为300
* ${env.scheduling.fixedRate}: 读取系统配置项
* #intervals: 读取宿主对象的intervals字段值作为值字段类型必须是int、long数值类型
*
@@ -79,7 +79,7 @@ public @interface Scheduled {
* 起始延迟时间,支持参数配置、乘法表达式和对象字段值 <br>
* 参数值支持方式:<br>
* 100: 设置数值
* 5*60: 乘法表达式值为30
* 5*60: 乘法表达式值为300
* ${env.scheduling.initialDelay}: 读取系统配置项
* #inits: 读取宿主对象的inits字段值作为值字段类型必须是int、long数值类型
*