How to configure a RetryScheduler in the default CommandGateway?

Hi everyone,

Is there a way to configure an IntervalRetryScheduler or ExponentialBackOffIntervalRetryScheduler in the default CommandGateway?

By default, there are no retry schedulers configured. Right?

In the documentation, I just found a way to configure a custom command gateway where you can configure a RetryScheduler.

https://docs.axoniq.io/reference-guide/configuring-infrastructure-components/command-processing/command-dispatching#creating-a-custom-command-gateway

Is this the only way to configure a RetryScheduler?

I’m using Axon 4.3 with Spring Boot 2.2.

I’m a little confused about that.

Thank you,
Rodrigo Castilho

Hi Rodrigo Castilho,

All Axon’s infrastructure components follow the builder pattern.
To add a RetryScheduler to a CommandGateway implementation, it’s thus suggested to check the Builder’s javadoc on the matter.
Here’s a link to the DefaultCommandGateway.Builder for example.
As you can see, it contains a Builder#retryScheduler method which essentially does what you need.

Hope this helps!

Cheers,
Steven