Closed
Description
The KafkaProducer.send
function has a try/except clause that hides the exception in a custom serializer. This makes finding bugs inside custom serializer difficult.
Example code:
from kafka import KafkaProducer
def raiseError():
raise NameError
producer = KafkaProducer(bootstrap_servers="localhost:9092",
value_serializer=lambda m: raiseError(m))
producer.send("topic", "value", "key")
This program will not raise error even though it should. Adding except NameError:
in KafkaProducer.send
can solve this no raise issue, but I am not sure if this is a good idea.
Metadata
Metadata
Assignees
Labels
No labels