-
Notifications
You must be signed in to change notification settings - Fork 7
Bump @platformatic/kafka version #484
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,23 @@ export const getKafkaConfig = (): KafkaConfig => ({ | |
| clientId: randomUUID(), | ||
| }) | ||
|
|
||
| /** | ||
| * Deletes only the topics that currently exist. | ||
| * | ||
| * Workaround for a regression in @platformatic/kafka >= 2.3.0 where Admin#deleteTopics | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be a simple fix for @platformatic/kafka, I will create PR for it. Since we only use topics deletion in tests and the workaround is clean (checking existing topics before deletion makes sense), it should be fine to proceed with the version upgrade
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR for the library: platformatic/kafka#323 |
||
| * leaves a stale entry in its internal deduplication cache when the operation errors | ||
| * (e.g. deleting a non-existent topic). Reusing the same Admin instance afterwards causes | ||
| * subsequent deleteTopics calls for the same topics to hang. Filtering to existing topics | ||
| * avoids triggering that error path. | ||
| */ | ||
| export const deleteExistingTopics = async (kafkaAdmin: Admin, topics: string[]): Promise<void> => { | ||
| const existingTopics = await kafkaAdmin.listTopics() | ||
| const topicsToDelete = topics.filter((topic) => existingTopics.includes(topic)) | ||
| if (topicsToDelete.length === 0) return | ||
|
|
||
| await kafkaAdmin.deleteTopics({ topics: topicsToDelete }) | ||
| } | ||
|
|
||
| const resolveDIConfig = (awilixManager: AwilixManager): DiConfig => ({ | ||
| awilixManager: asFunction(() => awilixManager, SINGLETON_CONFIG), | ||
| kafkaConfig: asFunction(getKafkaConfig, SINGLETON_CONFIG), | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be compatible with
@platformatic/kafkarequirement