TIBCOSoftware/flogo

Issue in kafka subscriber

Open

#408 opened on Oct 13, 2018

View on GitHub
 (0 comments) (0 reactions) (1 assignee)CSS (2,348 stars) (290 forks)batch import
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.

Contributor guide