You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have many routes like the one below. When it comes under heavy load, that is, when there are too many messages from Kafka, the route seems to get stuck. Each event starts appearing with the same traceId. He only does this sometimes. Sometimes It happens after 3-4 days. I expect to see 1 received log with 1 traceId.
@Inject
CamelContext camelContext;
route:
camelContext.setUseMDCLogging(true);
from("kafka:{{kafka.test.in.topic.name}}").routeId(getRouteId("test", RouteType.KAFKA.getValue()))
.log("Received : ${body}")
.to("bean:EventUtil?method=createEvent(*,test,in)") -> mongo save async
.to("bean:testServiceImp?method=process(*)") ->process and postgre save if same data exist return null
.choice().when(body().isNull())
.log("The route was terminated because body was null")
.endChoice().otherwise()
.to("bean:EventUtil?method=setHeader(*,grn-pnf, com.test.event.test)") -> kafka message header set
.process(exchange -> {
CloudEventDTO<testDTO> message = mapper.readValue(exchange.getIn().getBody(String.class), new TypeReference<CloudEventDTO<testDTO>>() {
});
message.setId(exchange.getMessage().getHeader(CloudEvent.CE_ID.getValue(), String.class));
message.setSource(exchange.getMessage().getHeader(CloudEvent.CE_SOURCE.getValue(), String.class));
message.setType(exchange.getMessage().getHeader(CloudEvent.CE_TYPE.getValue(), String.class));
message.setSubject(exchange.getMessage().getHeader(CloudEvent.CE_SUBJECT.getValue(), String.class));
message.setSpecVersion(exchange.getMessage().getHeader(CloudEvent.CE_SPECVERSION.getValue(), String.class));
message.setDataContentType(exchange.getMessage().getHeader(CloudEvent.CONTENT_TYPE.getValue(), String.class));
message.setTime(LocalDateTime.now(Clock.systemUTC()));
exchange.getMessage().setBody(mapper.writeValueAsString(message));
})
.to("bean:EventUtil?method=createEvent(*,test,out)")
.to("kafka:{{kafka.test.topic.name}}")
.log("Sent: ${body} To: " + getTopicName("test", RouteDirection.OUT.getValue()))
.end();
log example:
2023-09-29 01:14:04.376
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=2e202a2bbe6d5360, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Received : {"testJson}
2023-09-29 01:14:04.377
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=2e202a2bbe6d5360, spanId=d8fb606803bb3571, sampled=true [ri.gr.wo.se.pa.im.TestInfoServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Info
2023-09-29 01:14:04.378
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=2e202a2bbe6d5360, spanId=d8fb606803bb3571, sampled=true [ri.gr.wo.se.pa.im.TestInfoSsrServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Ssr Info
2023-09-29 01:14:04.378
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=2e202a2bbe6d5360, spanId=d8fb606803bb3571, sampled=true [ri.gr.wo.se.AbstractService] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) The same data exists. Entity id: 11,015,523
2023-09-29 01:14:04.379
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=2e202a2bbe6d5360, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) The route was terminated because body was null
2023-09-29 01:14:04.379
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=1bc2b6898c093d0f, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Received : {"testJson"}
2023-09-29 01:14:04.379
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=1bc2b6898c093d0f, spanId=b34387e031536af4, sampled=true [ri.gr.wo.se.pa.im.TestInfoServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Info
2023-09-29 01:14:04.380
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=1bc2b6898c093d0f, spanId=b34387e031536af4, sampled=true [ri.gr.wo.se.pa.im.TestInfoSsrServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Ssr Info
2023-09-29 01:14:04.380
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=1bc2b6898c093d0f, spanId=b34387e031536af4, sampled=true [ri.gr.wo.se.AbstractService] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) The same data exists. Entity id: 11,015,766
2023-09-29 01:14:04.381
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=1bc2b6898c093d0f, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) The route was terminated because body was null
2023-09-29 01:14:04.381
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=5b9b07ed0b44243b, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Received : {"testJson"}
2023-09-29 01:14:04.381
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=5b9b07ed0b44243b, spanId=82c81dd9f9f2a097, sampled=true [ri.gr.wo.se.pa.im.TestInfoServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Info
I don't know if it will solve it or have any effect, but I recently added the following properties. I'm monitoring it, if it increases again I'll write again, I'm not sure this is the problem.
Bug description
route:
pom:
log example:
2023-09-29 01:14:04.376
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=2e202a2bbe6d5360, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Received : {"testJson}
2023-09-29 01:14:04.377
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=2e202a2bbe6d5360, spanId=d8fb606803bb3571, sampled=true [ri.gr.wo.se.pa.im.TestInfoServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Info
2023-09-29 01:14:04.378
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=2e202a2bbe6d5360, spanId=d8fb606803bb3571, sampled=true [ri.gr.wo.se.pa.im.TestInfoSsrServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Ssr Info
2023-09-29 01:14:04.378
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=2e202a2bbe6d5360, spanId=d8fb606803bb3571, sampled=true [ri.gr.wo.se.AbstractService] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) The same data exists. Entity id: 11,015,523
2023-09-29 01:14:04.379
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=2e202a2bbe6d5360, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) The route was terminated because body was null
2023-09-29 01:14:04.379
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=1bc2b6898c093d0f, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Received : {"testJson"}
2023-09-29 01:14:04.379
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=1bc2b6898c093d0f, spanId=b34387e031536af4, sampled=true [ri.gr.wo.se.pa.im.TestInfoServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Info
2023-09-29 01:14:04.380
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=1bc2b6898c093d0f, spanId=b34387e031536af4, sampled=true [ri.gr.wo.se.pa.im.TestInfoSsrServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Ssr Info
2023-09-29 01:14:04.380
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=1bc2b6898c093d0f, spanId=b34387e031536af4, sampled=true [ri.gr.wo.se.AbstractService] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) The same data exists. Entity id: 11,015,766
2023-09-29 01:14:04.381
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=1bc2b6898c093d0f, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) The route was terminated because body was null
2023-09-29 01:14:04.381
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=09e679cba592a965, spanId=5b9b07ed0b44243b, sampled=true [testInfoKafkaRoute] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Received : {"testJson"}
2023-09-29 01:14:04.381
22:14:04 INFO traceId=6012f1fb50dadbf148ff61c7a764d7f7, parentId=5b9b07ed0b44243b, spanId=82c81dd9f9f2a097, sampled=true [ri.gr.wo.se.pa.im.TestInfoServiceImp] (Camel (camel-1) thread #6 - KafkaConsumer[com.test.topic.in.test.test]) Processing... Incoming Test Info
I don't know if it will solve it or have any effect, but I recently added the following properties. I'm monitoring it, if it increases again I'll write again, I'm not sure this is the problem.
quarkus.otel.traces.sampler=traceidratio
quarkus.otel.traces.sampler.arg=1.0
The text was updated successfully, but these errors were encountered: