公告板
版本库
filestore
活动
搜索
登录
main
/
fanli-server
返利
概况
操作记录
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
update .gitignore
admin
2021-01-27
92f1d85ddc449ce7452f9d52f8b081e6b69c720b
[fanli-server.git]
/
fanli
/
src
/
main
/
java
/
com
/
yeshi
/
fanli
/
util
/
mq
/
rocket
/
RocketMQUtil.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.yeshi.fanli.util.mq.rocket;
public class RocketMQUtil {
// "1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h";
private static int[] DELAYS_S = new int[] { 1, 5, 10, 30, 60, 120, 180, 240, 300, 420, 480, 540, 600, 1200, 1800,
3600, 7200 };
/**
* 获取延时等级
* @Title: getDelayLevel
* @Description:
* @param s
* @return
* Integer 返回类型
* @throws
*/
public static Integer getDelayLevel(int s) {
for (int i=0;i<DELAYS_S.length;i++) {
if(DELAYS_S[i]==s)
return i+1;
}
return null;
}
}