I am using spring integration dsl to create a pipeline to enrich and persist the event from kafka to DB. There can be multiple event types and we have create an event interface and corresponding implementation classes.
Event interface has method definition - parse(), process(), persist() And the implementation class has the implementation
@Bean
public IntegrationFlow baseEventFlow() {
return IntegrationFlows.from(Kafka.messageDrivenChannelAdapter(kafkaListenerContainer))
.wireTap(WIRE_TAP_CHNL) // Log the raw messaged
.handle(eventDispatch, "preProcess")
.handle(eventDispatch, "dispatch") //identify the implementation class from the event name
.handle(???,"parse") //get the classname from the above handler and then invoke methods
.handle(???,"validate")
.get();
.handle(eventDispatch, "dispatch") -> gives out the implementation class name at runtime
how can i call method on this class name, as I get the class at runtime based on some input events