I have an application that handles incoming data in an asynchronous thread via recurring callbacks - imagine a queue of data objects that are being processed and pushed to a Kafka endpoint. Each data object is processed inside a separate callback (all callbacks in the same thread).
I have a global producer object that is shared by all the callbacks for the 'Kafka Push'. Everything works fine with syncSend but the is see some form of data corruption (see garbage values) in the pushed data with the default (async) send. Is this normal?
My first thought was that shared global object is causing incorrect interleavings. But isn't the Kafka Producer thread safe by design?
I have an application that handles incoming data in an asynchronous thread via recurring callbacks - imagine a queue of data objects that are being processed and pushed to a Kafka endpoint. Each data object is processed inside a separate callback (all callbacks in the same thread).
I have a global producer object that is shared by all the callbacks for the 'Kafka Push'. Everything works fine with syncSend but the is see some form of data corruption (see garbage values) in the pushed data with the default (async) send. Is this normal?
My first thought was that shared global object is causing incorrect interleavings. But isn't the Kafka Producer thread safe by design?