Commit ec4c353c authored by 张彦钊's avatar 张彦钊

change test file

parent 6b325b05
......@@ -14,12 +14,9 @@ def on_send_error():
print("fail")
return 0
if __name__ == "__main__":
producer = KafkaProducer(
bootstrap_servers=['172.16.44.25:9092'],
key_serializer=lambda k: pickle.dumps(k),
value_serializer=lambda v: pickle.dumps(v))
producer = KafkaProducer(bootstrap_servers=['172.16.44.25:9092'],key_serializer=lambda k: pickle.dumps(k),value_serializer=lambda v: pickle.dumps(v))
print("hajs")
producer.send(topic = "test_topic", key = "hello", value = "world")\
.add_callback(on_send_success).add_errback(on_send_error)
producer.flush()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment