Hi,
We are running a load testing on Axon application and found performance issue. On debugging we have found the suspected place in our code.
There is a spring-boot kafka listner, reads the events from a kafka topic and sending to command handler through command gateway-
@KafkaListener(
topics = topic,
groupId = ID,
containerFactory = Constants.LISTENER_CONTAINER_FACTORY)
public void fromKafka(final ConsumerRecord<byte[], byte[]> records,
@Header(KafkaHeaders.RECEIVED_PARTITION_ID) final String partitionID) {
Optional<String> topic = Optional.ofNullable(records.topic());
topic.ifPresent(
s -> LOGGER.info("Read from the topic: {}, with Partition: {} ",
s, partitionID));
try {
---------------------
commandGateway.send(new MakeClassificationCmd(UUID,
tradeAd));
..........................
}
}
There is a command handler which subscribe the command from the command bus.
@CommandHandler
public ClassificationAd handle(final MakeClassificationCmd cmd) {
........................
.....................
}
we are sending high volume events to the kafka topic. AS per current implementation, commad is subscribed and process sequnetially from command bus. This gives us challange in achieving required performance.
Configuration details:
Event store - mongodb
simple command bus.
All commads sending to the same aggregate identifier.
Can you please help us how we can achieve the performance in a scenario when we have to send commands to the same aggregate object and command handler.
Thanks and Regards,
Kundan Kumar