Open cer opened 2 years ago
To configure the SwimlaneBasedDispatcher
, configure an @Bean
that implements TopicPartitionToSwimLaneMapping
.
For example, see SwimlanePerTopicPartition
One more thing to consider: pass the message key
to toSwimLane(TopicPartition topicPartition)
to enable parallelism within a TopicPartition
.
I believe that MultipleSwimlanesPerTopicPartitionMapping
is unnecessarily complicated.
A simpler implementation could simply hash(topic and messageKey) % desiredNumberOfSwimlanes
.
This will preserve ordering of all messages published to a topic (e.g. Aggregate type) with the same message key (e.g. aggregate ID)
Currently,
SwimlaneDispatcher
parallelizes message processing by partition.Proposal:
(topic, partition) -> thread
algorithm configurable