Open Dogacel opened 3 months ago
Is this still a problem? What was the culprit?
Is this still a problem? What was the culprit?
I did not mean to complete this 😭 I have reverted this change in an internal repo and linked this issue, thus it automatically resolved.
Is this still a problem? What was the culprit?
We have some options, my first attempt is this:
private static <T> BiFunction<? super RequestContext, T, JsonNode>
defaultContentSanitizer(ObjectMapper objectMapper) {
return (requestContext, obj) -> {
if (obj instanceof RpcRequest) {
RpcRequest rpcRequest = (RpcRequest) obj;
ObjectNode node = objectMapper.createObjectNode();
node.put("method", rpcRequest.method());
node.put("serviceName", rpcRequest.serviceName());
node.set("params", objectMapper.valueToTree(rpcRequest.params()));
return node;
}
return objectMapper.valueToTree(obj);
};
This works somewhat fine, however JSON formatting of RPC based params is incorrect. Protobuf messages can't be serialized using Object Mappers, there is some kind of recursion happening.
I don't even know how to serialize other types such as Thrift. Maybe we can check params and if they extend Message
proto type, we can use jsonPrinter
?
I have created a draft PR here: https://github.com/line/armeria/pull/5873
For whatever reason my test can't capture logger.info
(even though it is being called 🤔)
I am geetting the following error:
All I am doing is adding the following to my server and calling some gRPC endpoints:
test reprod under
JsonLogFormatterTest
,