What is the recommended way to selectively disable all command and event processing in a spring boot environment?
I’d like to create a background worker that processes long-running tasks (see db-scheduler, which is actually a fantastic non-Quartz scheduler). This worker should be able to send commands and queries as part of task execution, but should not handle any commands or events to preserve resources for tasks.
One strategy I have used successfully is to isolate the domain code such that there are simply no event processors to run or aggregates to service. In this particular case it is much easier to share the code with the primary domain image and assign a profile to the workers. I have a custom event storage engine bean, but the auto-configuration will happily create a replacement when my custom bean is disabled. Setting # threads to zero results in exceptions. I am hoping there is a config item such as axon.eventhandling.enabled=false
and axon.commandhandling.enabled=false
.