Skip to content

WIP: New produce command#1591

Closed
jackdelahunt wants to merge 4 commits intomainfrom
produce-command
Closed

WIP: New produce command#1591
jackdelahunt wants to merge 4 commits intomainfrom
produce-command

Conversation

@jackdelahunt
Copy link
Contributor

@jackdelahunt jackdelahunt commented Jun 8, 2022

This PR adds a produce command to a kafka topic to allow the user to produce messages for a topic. Flags like the partition and key are optional. This is useful for debugging purposes and currently you need another thrid-party kafka cli for this feature.

Still not complying with design guidelines yet

Verification Steps

  1. Create a kafka instance with a topic
  2. Run echo text | rhoas kafka topic produce --name=<topic-name>
  3. Go to console.redhat.com -> kafka instances -> instance -> topics -> topic-name -> messages and confirm message is being seen
  4. Try other flags like --key and --partition and check if message has these correct values set

Type of change

  • New feature (non-breaking change which adds functionality)

Partition: &opts.partition,
}

_, _, err = api.RecordsApi.ProduceRecord(opts.Context, opts.topicName).Record(record).Execute()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future question:

What output we want to provide:

  1. Message to stderr
  2. Resulted record returned from the API
  3. Something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message to stderr with the record produced would be nice, something like the output you get when creating a Kafka instance.

One problem that might come up from this is when a value is binary, might give some weird output and break some terminals.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Could have table format as well!

@wtrocki
Copy link
Collaborator

wtrocki commented Jun 10, 2022

Looks good so far.

@jackdelahunt
Copy link
Contributor Author

Closing in favour of #1598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants