Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write_item not throwing exception when there is no connection #6

Open
jishnug007 opened this issue Oct 19, 2020 · 0 comments
Open

write_item not throwing exception when there is no connection #6

jishnug007 opened this issue Oct 19, 2020 · 0 comments

Comments

@jishnug007
Copy link

jishnug007 commented Oct 19, 2020

Please check the given snippet.
Exception throwing properly when no Kafka broker available in the starting stage.
But it's not throwing an exception while disconnecting the Kafka.

from time import sleep
from scrapy_kafka_export.writer import KafkaTopicWriter, \
    ScrapyKafkaTopicWriter

item_writer = ScrapyKafkaTopicWriter(
                bootstrap_servers="localhost:9092",
                topic="my-topic",
                batch_size=100,
                compression_type=None
            )
item = {}
while True:
    try:
        stats = item_writer.write_item(item)
        print(stats)
        sleep(5)
    except Exception as e:
        print(e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant