Pulsar producer send_async() with callback function acknowledging the sent message

451 Views Asked by At

I have a use case where messages from an input_topic gets consumed and sent to a list of topics. I'm using producers[i].send_async(msg, callback=callback) where callback = lambda res, msg: consumer.acknowledge(msg). In this case, consumer is subscribed to the input_topic. I checked the backlog of input_topic and it has not decreased at all. Would appreciate if you could point out how to deal with this? What would be the best alternative?

Thanks in advance!

1

There are 1 best solutions below

0
On

Have you checked the consumer.acknowledge(msg) has actually been called? One possibility is the producer cannot write messages to the topic, and if the producer with infinite send timeout, you will never get the callback.