Our current setup of sending data to kafka does not allow us to determine whether the data was successfully sent or failed to send. This is an oversight when we upgraded kafka-python, as the new .send() method doesn't return (or fail) if the record was unable to be sent (docs). Instead, it uses a future object that you can poll or add a callback to in order to understand if the data was sent successfully or not.
We should use the callback functionality provided and ensure we properly log success or failures. This impacts the Redis Monitor, Rest, and Item Pipeline specifically (anything that sends data to kafka).
Our current setup of sending data to kafka does not allow us to determine whether the data was successfully sent or failed to send. This is an oversight when we upgraded
kafka-python
, as the new.send()
method doesn't return (or fail) if the record was unable to be sent (docs). Instead, it uses a future object that you can poll or add a callback to in order to understand if the data was sent successfully or not.We should use the callback functionality provided and ensure we properly log success or failures. This impacts the Redis Monitor, Rest, and Item Pipeline specifically (anything that sends data to kafka).
sample code:
In fact, this may eliminate one of the items in the pipeline entirely.