-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows users to cleanup resources on long lived clients. We now allow the user to purge resources from the client for topics the user is no longer interested in ever producing to or consuming from. This also finally addresses two long standing TODOs in the client which were only ever relevant if we introduced the concept to lose assignments. As well, this also fixes a minor thing where the client would track regular expressions as topic names (although these were not requested). Purging while producing has some caveats which are disclosed in the documentation. I've tested the purging works by manually checking the entire contents of the client struct after purging with github.com/davecgh/go-spew/spew. As well, I've tested producing to a purged topic works properly (which required looking into why some things were dropped -- sequence numbers!) and I've tested purging and adding (next commit) while consuming repeatedly. Long term it would be beneficial to have integration tests here. Originally, this method was going to be separated by producing and consuming (PurgeProduceTopics, PurgeConsumeTopics), but a user likely is not producing to and consuming from the same topic in the same client, and if they are and want to purge, odds are they want to purge both sides. If there is a feature request in the future to separate them, new APIs can be added.
- Loading branch information
Showing
7 changed files
with
204 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters