smjn commented on PR #18928:
URL: https://github.com/apache/kafka/pull/18928#issuecomment-2676080184

   > Looking good now, with just one more area for improvement.
   > 
   > The output of the `kafka-share-groups.sh --delete` command in error cases 
is a bit untidy. Some examples:
   > 
   > `bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --delete 
--group SG1` when the group is not empty, the exception stack trace is printed. 
The equivalent for `bin/kafka-consumer-groups.sh` is much neater.
   > 
   > `bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --delete 
--group CG1` where CG1 is a consumer group prints an error message, and then 
prints the command usage message which is massive. Ideally, it would just say 
something like:
   > 
   > ```
   > * Group 'CG1' could not be deleted due to: 
java.lang.IllegalStateException: Group CG1 is not a share group.
   > ```
   > 
   > or something like that.
   
   @AndrewJSchofield Thanks for the review, incorporated comments.
   Sample outputs
   ```
   $ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --delete 
--group gs1                      [13:23:20]
   
   Error: Deletion of some share groups failed:
   * Share group 'gs1' could not be deleted due to: 
java.lang.IllegalArgumentException: Group 'gs1' is not a share group.
   ```
   
   ```
   $ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --delete 
--group gs1 --group gs2          [13:23:23]
   
   Error: Deletion of some share groups failed:
   * Share group 'gs1' could not be deleted due to: 
java.lang.IllegalArgumentException: Group 'gs1' is not a share group.
   * Share group 'gs2' could not be deleted due to: 
java.lang.IllegalArgumentException: Group 'gs2' is not a share group.
   ```
   
   ```
   $ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --delete 
--group gs1 --group gs2                     [13:23:19]
   
   Error: Deletion of some share groups failed:
   * Share group 'gs2' could not be deleted due to: 
org.apache.kafka.common.errors.GroupNotEmptyException: Share group 'gs2' is not 
EMPTY.
   
   These share groups were deleted successfully: 'gs1'
   ```
   
   ```
   $ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --delete 
--group gs1 --group gs2                     [13:25:38]
   
   Deletion of requested share groups ('gs1', 'gs2') was successful.
   ```
   
   ```
   $ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --delete 
--all-groups                                [13:25:40]
   
   Deletion of requested share groups ('gs1', 'gs2') was successful.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to