> I have a backend service written in PHP. This service pushes messages to > Apache Kafka (over the topic "posts") when posts are created, read and > removed. I also have a backend service written in Java. This service > consumes messages from Apache Kafka (for the "posts" topic) and push them > out over WebSockets to whoever is listening. This works out great. > > The problem I have is as follows. Say, for some reason, the WebSocket > client timeout and because of this he or she does not get some of the > messages. The messages are still being consumed but the client isn't there > to acknowledge them. Now, the client want "rewind" and get all the messages > that they missed may have missed. This is where I'm stuck. > > Ideally, the client would provide a timestamp for when they last got a > message and I'd then use that timestamp to get messages from that point and > onwards. I'm not sure if this is even possible, it's just my thoughts. > > Something like this was discussed a few weeks back on the list. But, essentially what you need to do is turn off auto commit and only commit when you're sure the message has been acknowledged by the next stage.
I think the link is this -> http://ingest.tips/2014/10/12/kafka-high-level-consumer-frequently-missing-pieces/ Regards, Sharninder