Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…o kafka

Conflicts:
	stac_generator/plugins/outputs/kafka.py
  • Loading branch information
rhysrevans3 committed Jul 3, 2024
2 parents 5bb5100 + f7149ed commit 697efab
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions stac_generator/plugins/outputs/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@ def __init__(self, **kwargs):
self.key_term = "uri"
self.producer = Producer(self.config)

def delivery_callback(err, msg):
if err:
print("ERROR: Message failed delivery: {}".format(err))
else:
print(
"Produced event to topic {topic}: key = {key:12} value = {value:12}".format(
topic=msg.topic(),
key=msg.key().decode("utf-8"),
value=msg.value().decode("utf-8"),
)
)

def export(self, data: dict, **kwargs) -> None:
"""
Post the message to the kafka server.
Expand All @@ -82,5 +70,4 @@ def export(self, data: dict, **kwargs) -> None:
key = data.get(self.key_term, None)
message = json.dumps(data).encode("utf8")
self.producer.produce(self.topic, key=key, value=message)

self.producer.flush()

0 comments on commit 697efab

Please sign in to comment.