spring cloud gateway response读取截断

发布时间:2021-06-17 12:23:01

解决截断的读取方式


return super.writeWith(fluxBody.buffer().map(dataBuffers -> {

                                DataBufferFactory dataBufferFactory = new DefaultDataBufferFactory();
                                DataBuffer join = dataBufferFactory.join(dataBuffers);
                                byte[] content = new byte[join.readableByteCount()];
                                join.read(content);
                                DataBufferUtils.release(join);
                                String responseData = new String(content, Charsets.UTF_8);
                                System.out.println("============"+responseData);
                                byte[] uppedContent = responseData.getBytes(Charsets.UTF_8);

                                return bufferFactory.wrap(uppedContent);
                            }));

Card image cap
APP STORE
Card image cap
应用宝
Card image cap
小米
Card image cap
华为