spring cloud gateway 获得响应body记录日志问题
原创 2019-10-30 11:07 阅读(2358)次
通常在spring cloud微服务架构中,需要在网关gateway中记录日志,比如需要记录响应的body,今天我也是一直遇到响应体记录不完整的问题,body被分段,对于响应报文大一点的请求中,在响应ServerHttpResponseDecorator包装中一次取得body只能取的一段。有问题的代码如下: ServerHttpResponse originalResponse = exchange.getResponse();
DataBufferFactory bufferFactory = originalResponse.bufferFactory();
Serve...
spring cloud gatewayThe ‘Access-Control-Allow-Origin’ header contains multiple values
原创 2019-07-16 20:53 阅读(4903)次
在spring cloud gateway网关中加入了跨域支持,但是报了:The ‘Access-Control-Allow-Origin’ header contains multiple values “*, *”, but only one is allowed.错误显示设置了两次Access-Control-Allow-Origin:*,但我的代码我确定只设置了一次,怀疑是哪出了问题,找了一上午问题,百度到说是gateway的bug我的版本:spring cloud gateway:2.1.2spring cloud: Greenwich.SR2解决办法如下:设置跨域:imp...
spring cloud gateway报错Only one connection receive subscriber allowed
原创 2019-07-08 11:06 阅读(4824)次
spring cloud网关报错:reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalStateException: Only one connection receive subscriber allowed.
Caused by: java.lang.IllegalStateException: Only one connection receive subscriber allowed.
at reactor.ipc.netty.channel.FluxReceive.startRecei...
openfeign与gateway中的httpClient类声明冲突
原创 2019-07-06 12:27 阅读(2940)次
启动spring cloud中的网关,报错:***************************APPLICATION FAILED TO START***************************Description:The bean 'httpClient', defined in class path resource [org/springframework/cloud/openfeign/ribbon/HttpClientFeignLoadBalancedConfiguration$HttpClientFeignConfiguration.class], could not...