AxonFramework / ReferenceGuide

The Reference Guide of Axon Framework
Apache License 2.0
29 stars 22 forks source link

Question > How Kafka partitions are managed by Axon #86

Open ghilainm opened 6 years ago

ghilainm commented 6 years ago

Currently it seems there is no documentation on how Kafka partitions are managed Axon.

Example of questions:

Could you please provide some insight on this? Would be nice to have a paragraph in the documentation explaining the general integration of Axon with Kafka.

altroy75 commented 6 years ago

If I'm not mistaken, it looks like having a Kafka topic with several partitions and at the same time more than one Axon segment can potentially lead to skipped, not processed events. Consider a situation with a topic with two partitions and two configured Axon processor's segments. Also let's assume two JVMs trying to process events concurrently. In such scenario kafka consumer in each JVM will be assigned with one of the two partitions. Then the event processor in each JVM will try to lock a segment. Now it might happen that an event processor's segment doesn't match some or all events in its kafka consumer's partition (those events are in the second partition), in which case we will have skipped event messages. Is the above scenario a valid one or I'm missing something?

Thanks, Alex