telstra / open-kilda

OpenKilda is an open-source OpenFlow controller initially designed for use in a global network with high control-plane latency and a heavy emphasis on latency-centric data path optimisation.
Apache License 2.0
77 stars 53 forks source link

add logs to KafkaProducerService. #5680

Closed IvanChupin closed 3 weeks ago

IvanChupin commented 4 weeks ago

additional logs for callback that shows the request message content of the request causing the error.

Here is the code line that responsible for the log: logger.error("Fail to send message(correlationId=\"{}\") in kafka topic={}: Message json: {}.",correlationId, topic, messageJson, exception);

Also in a corresponding unit test :KafkaProducerServiceTest.errorReporting() We can see the actual error log with the message json:

2024-06-06 10:35:54,201 ERROR KafkaProducerService$SendStatusCallback:213 - [] Fail to send message(correlationId="org.openkilda.floodlight.service.kafka.KafkaProducerServiceTest-test") in kafka topic=A: Message json: {"clazz":"org.openkilda.messaging.info.InfoMessage","payload":{"clazz":"org.openkilda.messaging.info.event.PortInfoData","switch_id":"ff:fe:00:00:00:00:00:01","port_no":8,"state":"UP","timestamp":1717670153969},"timestamp":1717670153969,"correlation_id":"org.openkilda.floodlight.service.kafka.KafkaProducerServiceTest-test","destination":null,"region":null,"cookie":null}
    java.util.concurrent.ExecutionException: Emulate kafka send error
image