auto

auto

V2EX member #399396, joined on 2019-04-08 09:43:33 +08:00
Per auto's settings, the topics list is hidden
Deals info, including closed deals, is not hidden
auto's recent replies
Dec 30, 2021
Replied to a topic by MIUIOS Java 练习两年半的同事写的代码
Dec 24, 2021
Replied to a topic by auto 程序员 腾讯云崩了?
@guansixu 我们的恢复了,看样子解决这么快像是网络问题
Dec 24, 2021
Replied to a topic by auto 程序员 腾讯云崩了?
@Longerrrr 我们的全是北京的
Dec 8, 2021
Replied to a topic by auto Java 请教一个 springcloud gateway 限流的问题
@ouyc 电脑 8 核的 cpu ,本地 springboot 自带的 tomcat 映射的线程数等于本机 cpu 核数?
Dec 8, 2021
Replied to a topic by auto Java 请教一个 springcloud gateway 限流的问题
@zt52875287 当时测试的时候,高并发下 RequestRateLimiterGatewayFilterFactory 用的 redistemplate 似乎一直占着 redis 连接,导致项目中其他地方使用的 redission 重试几次以后超时报错了。想过重写 RequestRateLimiterGatewayFilterFactory 的 RedisRateLimiter ,但是有点麻烦就换了种简单的方法
Dec 7, 2021
Replied to a topic by auto Java 请教一个 springcloud gateway 限流的问题
@devswork RequestRateLimiterGatewayFilterFactory 用的 redistemplate
Dec 7, 2021
Replied to a topic by auto Java 请教一个 springcloud gateway 限流的问题
@devswork 默认用的 redistemplate ,项目中用的 redission ,两者一起用有点问题,所以换了种方案。
Dec 7, 2021
Replied to a topic by auto Java 请教一个 springcloud gateway 限流的问题
贴个代码:
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
log.info("==================进来了===================");
String luaScript = buildLuaScript();
ServerHttpRequest request = exchange.getRequest();
String path = request.getPath().value();
List<String> excludUrls = properties.getExcludUrls();
// 路径在不限流列表中,直接跳过
if (CollectionUtils.isNotEmpty(excludUrls) && excludUrls.contains(path)) {
return chain.filter(exchange);
}
String ip = HostUtil.getRequesHost2(request);
Thread.sleep(20000);
Number count = redissonService.executeLua(luaScript, Collections.singletonList(path+"_"+ip),
properties.getCount(), properties.getPeriod());
.....省略部分
}
@shoaly 可能不能直接调 ali 的接口,万一哪天这个接口收费了咋办👀
@z9961 似乎只能 windows ?
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1813 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 16:16 · PVG 00:16 · LAX 09:16 · JFK 12:16
♥ Do have faith in what you're doing.