Skip to content

Conversation

@paulojmdias
Copy link
Member

Description

Add a new exclude_topic option to allow users to exclude topics when using the Kafka receiver with a regex on the topic consuming definition.

Link to tracking issue

Fixes #43782

Testing

Added tests to validate this functionality and the configuration itself.

Documentation

Updated documentation with the option and with an explicit example.

@paulojmdias paulojmdias marked this pull request as ready for review November 8, 2025 22:49
@paulojmdias paulojmdias requested review from a team, MovieStoreGuy and axw as code owners November 8, 2025 22:49
Signed-off-by: Paulo Dias <[email protected]>
…lector-contrib into feat/43782

Signed-off-by: Paulo Dias <[email protected]>
config *Config,
set receiver.Settings,
topics []string,
excludeTopics []string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why accept an array here?

Copy link
Member Author

@paulojmdias paulojmdias Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built this way to keep the same input type as the topic field, which is defined in config as a string but is set here as an array. I'm open to supporting this as an array (maybe renamed to exclude_topics), but for parity, IMO we should fill an issue to evaluate transforming the topic field into a native list of strings too.

I would like to have inputs here from the other codeowners @axw, @MovieStoreGuy, and @pavolloffay 🙏

}, nil
}
return newReceiver(config, set, []string{config.Logs.Topic}, newConsumeMessageFunc)
return newReceiver(config, set, []string{config.Logs.Topic}, []string{config.Logs.ExcludeTopic}, newConsumeMessageFunc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to make this an array of string in the config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/kafka] Add support for exclude topics when using regex

3 participants