Skip to content
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

Console commands #119

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Console commands #119

wants to merge 4 commits into from

Conversation

rdiomar
Copy link
Collaborator

@rdiomar rdiomar commented Feb 4, 2014

This adds ConsoleProducer/Consumer classes and 3 simple scripts for producing, consuming, and creating topics. This can be useful for testing and checking the state of things in kafka.

These commands are minimal right now, but more options/features can be added in the future.

How to use:

$ kp_create_topic -b 127.0.0.1:9092 -t "hello"
$ kp_producer -b 127.0.0.1:9092 -t "hello"
yo dude
what's up?

# Meanwhile, in another terminal...
$ kp_consumer -b 127.0.0.1:9092 -t "hello" -g "analytics"
yo dude
what's up?

This change is Reviewable

Seems better to use an optional timeout with a default value
rather than hard-coding 30 retries, especially since each request can
block for a long time then fail.
@rdiomar
Copy link
Collaborator Author

rdiomar commented Feb 5, 2014

I need to make some changes to make the options required options. Please don't merge yet

@rdiomar
Copy link
Collaborator Author

rdiomar commented Feb 5, 2014

Ok, added support for required arguments and renamed _command_utils.py to _script_utils.py.

@@ -0,0 +1,35 @@
import logging
from optparse import OptionParser, Option, OptionValueError
Copy link
Collaborator

Choose a reason for hiding this comment

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

optparse is marked as deprecated, use argparse instead.

Deprecated since version 2.7: The optparse module is deprecated and will not be developed further; development will continue with the argparse module.

I believe it will be a drop in replacement for the changes you are making.

@sontek
Copy link
Contributor

sontek commented Feb 11, 2015

I think this is a great idea but this no longer merges cleanly. I think we may want to build this in a slightly different way as well. I'll work on a PR as a brain dump to show you what I'm thinking.

@jeffwidman
Copy link
Contributor

This is pretty old and the Kafka world has moved on a bit. At this point, I think this should PR should be rejected in favor of a combination of using Kafka's pre-packaged CLI scripts + adding an AdminClient interface to kafka-python (#935).

@dpkp
Copy link
Owner

dpkp commented Feb 1, 2017

perhaps. but omar was a close friend who passed away and I have a hard time closing this for personal reasons.

@jeffwidman
Copy link
Contributor

I'm sorry for your loss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants