good first issuekind/bug
Description
Current behavior (how does the issue manifest):
When using flogo api, kafka sub with multiple handlers for different topics, will deliver same message from every topic to every handlerFunc.
Expected behavior:
Only messages for the specified handler topic should be delivered to the handler's handlerFunc.
Minimal steps to reproduce the problem (not required if feature enhancement):
Here is example code.
app := flogo.NewApp()
kafkaSettings := map[string]interface{}{
"BrokerUrl": brokerUrl,
}
trg := app.NewTrigger(&kafkasub.KafkaSubTrigger{}, kafkaSettings)
trg.NewFuncHandler(map[string]interface{}{"Topic": topic1}, HandleEvent1)
trg.NewFuncHandler(map[string]interface{}{"Topic": topic2}, HandleEvent2)
e, err := flogo.NewEngine(app)
if err != nil {
logger.Error(err)
return
}
engine.RunEngine(e)
Messages delivered to topic1 will be sent to handlerFunc's HandleEvent1 and HandleEvent2.
Look at line 358 in the trigger.go for the subscriber.