0

I'm trying to send data from one topic in Kafka to another using Faust. If the value in the original topic is None (the message is a tombstone), I'm sending the current key with a None value to the target topic.

async def order_delete(key, target_topic):
    await target_topic.send(key=key, value=None, headers={'__op': b'd'})
                                                       

@app.agent(topic)
async def order_info(orders):
    async for key, order in orders.items():

        if order is None:
            for target_topic in target_topics.values():
                await order_delete(key, target_topic)
            continue

I expect it to be a tombstone in the target topic, but it's not. It has a delete header and the value of:

"ERROR":{ "message":"src property must be a valid json object" }

I'm new to Faust so I'm probably missing something... Is there a way to send tombstones with it?

3 Answers3

0

Looks like you are having a similar issue as the one flagged here https://github.com/robinhood/faust/issues/143

Ftisiot
  • 1,808
  • 1
  • 7
  • 13
0

Simplest solution for me looks like sending empty dictionary {}. It is still valid json.

aaossa
  • 3,763
  • 2
  • 21
  • 34
0

I asked the guys in faust slack channel and it seems there is no way to send tombstones in faust. In the end I decided to go with sending an empty json