We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RouteLocator 配置信息 @bean public RouteLocator customRouteLocator(RouteLocatorBuilder builder) { return builder.routes()// .route(p -> p.path("/a/") .uri("lb://a")) .route(p -> p.path("/b/") .uri("lb://b"))
.build(); }
ReadBodyPredicateFactory: 当前使用的版本的代码如下: return bodyInserter.insert(outputMessage, new BodyInserterContext()) // .log("modify_request", Level.INFO) .then(Mono.defer(() -> { boolean test = (Boolean) exchange.getAttributes() .getOrDefault(TEST_ATTRIBUTE, Boolean.FALSE); exchange.getAttributes().remove(TEST_ATTRIBUTE); exchange.getAttributes().put(CACHED_REQUEST_BODY_KEY, outputMessage.getBody()); return Mono.just(test); })); };
GlobalLogFilter: private static final String CACHED_REQUEST_BODY_KEY = "cachedRequestBody"; String bodyStr = exchange.getAttribute(CACHED_REQUEST_BODY_KEY);
bodyStr 还是为空,是需要啥配置才能获取到数据呢?
The text was updated successfully, but these errors were encountered:
这破竹就是在瞎写
Sorry, something went wrong.
No branches or pull requests
RouteLocator 配置信息
@bean
public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
return builder.routes()//
.route(p -> p.path("/a/") .uri("lb://a"))
.route(p -> p.path("/b/") .uri("lb://b"))
ReadBodyPredicateFactory:
当前使用的版本的代码如下:
return bodyInserter.insert(outputMessage, new BodyInserterContext())
// .log("modify_request", Level.INFO)
.then(Mono.defer(() -> {
boolean test = (Boolean) exchange.getAttributes()
.getOrDefault(TEST_ATTRIBUTE, Boolean.FALSE);
exchange.getAttributes().remove(TEST_ATTRIBUTE);
exchange.getAttributes().put(CACHED_REQUEST_BODY_KEY,
outputMessage.getBody());
return Mono.just(test);
}));
};
GlobalLogFilter:
private static final String CACHED_REQUEST_BODY_KEY = "cachedRequestBody";
String bodyStr = exchange.getAttribute(CACHED_REQUEST_BODY_KEY);
bodyStr 还是为空,是需要啥配置才能获取到数据呢?
The text was updated successfully, but these errors were encountered: