4
votes

I'm starting with Akka Streams and so far everything is going well. However, I have met with a use case that I don't know how to approach. The scenario is a stream with an ActorPublisher as a source that is consuming messages from Kafka and a subscriber as a sink that updates a Cassandra table.

Kafka ~> some mapping operations ~> Cassandra

The point is that I'd like to explicitly confirm to Kafka every time a message has been successfully processed and inserted into Cassandra so that I could re-read the message in case a disaster happens and the service fails, i.e. some kind of at least once delivery behaviour. How could I approach this in terms of Akka Streams?. Is a supported scenario?.

It's true that I always can configure the Kafka consumer with auto-commit behaviour but I'd rather take control of how I'm reading the messages.

Update

Regarding this topic, we're currently evaluating Reactive Kafka where they've included manual commit in kafka as of 0.8 version (kudos for these guys). This feature would allow us implement the alod behaviour we need.

1

1 Answers

2
votes

I think you could use a custom stream processing using a PushPullStage as explained in akka streams documentation