Github user mtaylor commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/924#discussion_r92656323
--- Diff:
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/queue/UpdateQueue.java
---
@@ -31,7 +31,7 @@
String name;
@Option(name = "--deleteOnNoConsumers", description = "whether to
delete when it's last consumers disconnects)")
- Boolean deleteOnNoConsumers = null;
+ String deleteOnNoConsumers = null;
--- End diff --
There's an underlying problem with this approach. The presence of an
argument represents true and the non presence represents false. But what if
the field is optional? Does that imply false? Specifically if you want to
update say a queue by setting "deleteOnNoConsumers" to a different value that
is already set, how do we distinguish whether or not the user wants to set it
to false, or the user does not want to update it?
IMO it's better to be explicit about options like this. If we really want
to keep the presence as an option then perhaps we can add another flag,
enableDeleteOnNoConsumers, IMO this is less usable than just adding an option
for "true" or "false" to be passed in.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---