-
Notifications
You must be signed in to change notification settings - Fork 30
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
Introduce deletion-mode for topics #418
Conversation
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.
I have left some comments
I am not sure that this is enough clear
deletion-mode: delete
what about:
deletion-mode: delete-on-uninstall
because 'delete' means too less (or too much)
@@ -147,6 +152,11 @@ public void deployAsset() throws Exception { | |||
} | |||
} | |||
} | |||
|
|||
@Override | |||
public void deleteAsset() throws Exception { |
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.
we can add a "default" method implementation here
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.
this code is not actually called, I'll follow up in the next pr
@@ -354,6 +354,7 @@ private Topic buildImplicitTopicForDeadletterQueue( | |||
new TopicDefinition( | |||
name, | |||
creationMode, | |||
TopicDefinition.CREATE_MODE_NONE, |
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.
this should be the same as the original topic, the same way we do for "creationMode"
log.info("Topic {} does not exist", topic.name()); | ||
} else { | ||
throw e; | ||
if (topic.deleteMode().equals(TopicDefinition.DELETE_MODE_DELETE)) { |
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.
topic.deleteMode() may be null for old pipelines, please use Objects.equals()
} | ||
} | ||
default -> log.info("Keeping Kafka topic {}", topic.name()); | ||
default -> log.info( | ||
"Keeping Kafka topic {} since creation-mode is {}", |
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.
this is not clear
Changes:
deletion-mode
Possible values are
none
,delete
none
is the default value.none
means to keep the topic when the app is deleteddelete
means to delete the topic when the app is deletedNote that
delete
works only if thecreation-mode
iscreate-if-not-exists
. This is because in that case we know that we can actually manage that topic inside the langstream app.Example: