Hi all,
is it possible to configure the EventHandler to be disabled? If not, what would be the cleanest solution to directly disable the EventHandler in an SpringBoot - Kotlin setup?
I tried to use the @PostConstruct Annotation but it disables the processors before axon configuration starts them.
@Value("\${axon.eventhandling.processors.tracingHeadersProjection.enabled}")
var tracingHeadersEnabled: Boolean = false
@PostConstruct
fun initialShutdownParallelizedProcessingGroup() {
logger.info { "PPG active: $tracingHeadersEnabled" }
if(!tracingHeadersEnabled){
eventProcessingConfiguration.eventProcessor(
TracingHeadersProjectionEventHandler.PROCESSING_GROUP,
StreamingEventProcessor::class.java
)?.ifPresent { streamingProcessor: StreamingEventProcessor ->
streamingProcessor.shutDown()
}
}
}
Environment variables enabled
are fetched from axon.yaml:
axon:
eventhandling:
processors:
allEventsProjection:
batch-size: ${ALL_EVENTS_PROJECTION_BATCH_SIZE:1}
mode: pooled
thread-count: ${ALL_EVENTS_PROJECTION_THREAD_COUNT:8}
initial-segment-count: ${ALL_EVENTS_PROJECTION_INITIAL_SEGMENT_COUNT:32}
sequencing-policy: traceEventsPropertyTraceIdSequencingPolicy
enabled: ${ALL_EVENTS_PROJECTION_ENABLED:false}
BR
lemon