In certain cases, I need to send a lot of commands in a short time (roughly 20k in a few seconds).
After sending a certain amount of commands, Axon raised a warning that the command cache would be full and that I should increase axoniq.axonserver.command-cache-capacity (12500 is the default) which I set to 100000 then.
After repeating my case, I now get a new warning:
22-10-2020 09:23:27.134 [grpc-default-executor-16] WARN o.a.c.gateway.DefaultCommandGateway.lambda$onResult$0 - Command ‘com.axxelia.axxalon.app.execution.api
.message.ChangeSchedulingStatusCommand’ resulted in org.axonframework.axonserver.connector.command.AxonServerCommandDispatchException([AXONIQ-4003] Failed to add request to queue
1@068e3eb6daa1.e24e99f6-2820-43b8-ac2d-013c5fafa8b6.default)
I’m now implementing a pause after sending 1000 commands. It’s clumsy, but let’s see if that helps.
Anyhow: it seems that once the above warnings occur, that the affected commands get lost! Is that right? If so, I think it would be better to raise an Exception that can be catched… so we can handle the problem.
Second question: as the aggregates that are the target for the command all need to receive that specific command - is there a better pattern than to send 1000’s of single commands?
It seems that command handlers are too slow and can’t catch up. The warning message that the command cache is full means that you should slow down the sending of commands or scale-up axon applications. Are command handlers getting process, can u measure the time needed to execute one command handler?
Let me confirm, you just see a warning in the log and you don’t get an exception, ever?
I’m guessing you are doing some bulk command send at a given point in time?
are you using “sendAndWait” to send commands or you use a send (completable future)? If u are using “send”, do you have an exceptionally block on your completable future?