Support appid level flow control #212

This commit is contained in:
hongqiaowei
2021-06-23 19:35:06 +08:00
committed by GitHub
parent 1ec59d51fc
commit 6733cf08c9
11 changed files with 532 additions and 128 deletions

View File

@@ -42,7 +42,7 @@ public class NetworkUtils {
private static String serverIp;
private static final String SERVER_IP = "SERVER_IP";
private static final String SERVER_IP = "SERVER_IP";
public static String getServerIp() {
try {

View File

@@ -71,6 +71,28 @@ public abstract class Utils {
b.append(k).append(c).append(v).append(separator);
}
public static String extract(String str, char separator, int nx) {
int begin = 0, end = 0, n = 0, ny = nx + 1, l = str.length();
for (int i = 0; i < l; i++) {
char c = str.charAt(i);
if (c == separator) {
n++;
if (n == nx) {
begin = i + 1;
} else if (n == ny) {
end = i;
break;
}
}
}
if (begin == 0) {
return Constants.Symbol.EMPTY;
} else if (end == 0) {
end = l;
}
return str.substring(begin, end);
}
public static String initials2lowerCase(String s) {
if (StringUtils.isBlank(s)) {
return s;