Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBZ-7244 Event Hubs topic routing #57

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aleksandervalle
Copy link

Seems like debezium#51 introduced a potential regression, where if the sink is configured with a custom producer, it is not wrapped in a BatchManager and batchManager will be null when handleBatch is invoked.
@aleksandervalle
Copy link
Author

aleksandervalle commented Dec 11, 2023

Thinking about adding an integration test, but would have to delve deeper into how tests are setup first, and how to add changes from another source table (to test topic routing for two different tables).

Seems like the second commit fixes an earlier potential regression. I'm not sure how I would configure a customProducer, but it doesn't seem like a customProducer would work (as it's not wrapped in a BatchManager).

@jpechane
Copy link
Contributor

@aleksandervalle Overall LGTM, thanks. I've one proposal, instead of adding a new config option I think it is ok just to modify the existing one to be able to process the list instead of a single value. It will be backward compatible, the code will be simplified and no new option is needed.

@aleksandervalle
Copy link
Author

@aleksandervalle Overall LGTM, thanks. I've one proposal, instead of adding a new config option I think it is ok just to modify the existing one to be able to process the list instead of a single value. It will be backward compatible, the code will be simplified and no new option is needed.

I removed the new optional config, and we're now using the required debezium.sink.eventhubs.hubname config. Using eventHubNames[0] as fallback in case record.destination() does not match any of the given event hub names in the configuration. This should ensure backwards compatibility, as far as I can see.

@aleksandervalle
Copy link
Author

Maybe the documentation should be updated to reflect these changes? Idea for new description:

Specifies the name(s) of the Event Hub(s) to be used. You can provide a single hub name or a comma-separated list of hub names without any whitespace. When multiple hub names are specified, Debezium will direct the change events to the corresponding Event Hub based on the event's destination. If the destination of a change event does not match any of the listed hub names, the first hub in the list will be used as the default destination.

Usage Example: debezium.sink.eventhubs.hubname=hub1,hub2,hub3

In this example, hub1 serves as the default Event Hub if no specific matching is found for a change event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants