Missing traceback when using spring-cloud-starter-stream-rabbit consumer listeners.
Toxa45 opened this issue · 6 comments
Good day!
When I use this code
@slf4j
@configuration
@requiredargsconstructor
@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
public class MessageListener {
RequestProcessor requestProcessor;
@Bean
public Consumer<RequestDTO> consumer1() {
return requestProcessor::processConsumer1;
}
}
@slf4j
@service
@validated
@requiredargsconstructor
public class RequestProcessor {
public void processConsumer1(@Valid RequestDTO request) {
.......
}
}
If the input has a validation error, then the traceId and spanId are missing from the error message
Can you please answer all the required questions described in the issue template? For your convenience let me paste it here
Describe the bug
Please provide details of the problem, including the version of Spring Cloud that you
are using.Sample
If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.
Please check how to properly format the code
Spring Cloud 2021.0.5
Here is an example class.
@DaTa
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
public class RequestDTO {
@NotNull
String model;
}
If invalid data is received. For example
{
"model":null
}
Then the processing method falls with an error, but there is no traceId
And so with wide errors, you can throw an Exception in requestProcessor::processConsumer1 and traceId will also be missing. If something is logged inside requestProcessor::processConsumer1 - there is a traceId, but not in the error messages.
Can you please format the code properly? I can't see anything here.
Also can you please create a standalone project that replicates this issue in Java, Maven without Lombok? That would be super helpful.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.