Status

Current state: Approved

Discussion thread: here

Vote thread: here

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

ConsoleConsumer and ConsumerPerformance serve different purposes but share common functionality for message consumption. Currently, there's an inconsistency in their command-line interfaces:

  • ConsoleConsumer supports an --include argument that allows users to specify a regular expression pattern to filter topics for consumption
  • ConsumerPerformance lacks this topic filtering capability, requiring users to specify a single topic explicitly via --topic argument

This inconsistency creates two problems:

  1. Similar tools should provide similar topic selection capabilities for better user experience
  2. Users cannot test consumer performance across multiple topics or dynamically matching topic sets, making it difficult to test realistic scenarios

Public Interfaces

The ConsumerPerformance tool will be enhanced with the following new argument:

--include <String: Java regex (String)>  Regular expression specifying list of 
                                           topics to include for consumption.

When the --include argument is provided:

  • The consumer will subscribe to topics using pattern-based subscription instead of explicit topic list
  • All topics matching the regular expression pattern will be consumed from

Proposed Changes

The --include argument will be added to the ConsumerPerfOptions class.

This class will ensure that --include and --topic are mutually exclusive and one of them is required.

Compatibility, Deprecation, and Migration Plan

This change is fully backwards compatible as it introduces a new optional argument.

Test Plan

The ConsumerPerformanceTest will be integrated with the following tests:

  • Test argument parsing for valid and invalid regex patterns
  • Test mutual exclusivity of --include and --topic arguments
  • Test one of --include and --topic arguments is required

Rejected Alternatives

No rejected alternative.


  • No labels