Java 8的中Consumer、Supplier、Predicate和Function

这几个接口都在java.util.function包下的,分别是Consumer(消费型)、supplier(供给型)、predicate(谓词型)、function(功能性)

Consumer接口

从字面上看,Consumer接口就是一个消费型的接口,通过传入参数,然后输出值,就是这么简单

CompletableFuture 使用详解

runAsync 和 supplyAsync方法

CompletableFuture 提供了四个静态方法来创建一个异步操作。

1
2
3
4
public static CompletableFuture<Void> runAsync(Runnable runnable)
public static CompletableFuture<Void> runAsync(Runnable runnable, Executor executor)
public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier)
public static <U> CompletableFuture<U> supplyAsync(Supplier<U> supplier, Executor executor)

502错误 Nginx日志 upstream sent too big header while reading response header from upstream

1
2
2020/11/06 13:05:08 [error] 105478#0: *104739 upstream sent too big header while reading response header from upstream, client: 10.20.90.26, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.136.16:8088"
2020/11/06 13:05:08 [error] 105478#0: *104739 upstream sent too big header while reading response header from upstream, client: 10.20.90.26, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.136.16:8088", referrer: "http://192.168.16.16:8088/"

Spring Cloud Gray 采坑记录

实例状态问题

若实例添加为灰度实例,并且Gray StatusCLOSEInstance StatusDOWN,那么会报:

1
java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :