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

Add topic_new method with a sample for testing #1

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

Conversation

swehner
Copy link
Owner

@swehner swehner commented Dec 26, 2023

Add the topic_new method to allow per-topic configuration.

Ideally we'd like to set sub-second timeouts for some topics to get an early acknowledgment, but that doesn't seem to work: https://github.com/confluentinc/librdkafka/wiki/Producer-message-reliability#unresponsive-brokers

goto inner_err;
}

k = cfl_PyUnistr_AsUTF8(ks, &ks8);
Copy link

Choose a reason for hiding this comment

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

OMG... this wrapper to support py2 is ugly. I wish they could deprecate py2 and clean a lot of the internal helpers. :/

"Creates a new topic handle for topic named topic, allows setting a per-topic configuration\n"
"\n"
" :param str topic: Topic to create\n"
" :param dict conf: Configuration properties\n"
Copy link

Choose a reason for hiding this comment

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

Can this even set the servers? or those settings are limited to the producer config?

@@ -814,6 +891,13 @@ static PyMethodDef Producer_methods[] = {
{ "set_sasl_credentials", (PyCFunction)set_sasl_credentials, METH_VARARGS|METH_KEYWORDS,
set_sasl_credentials_doc
},
{ "topic_new", (PyCFunction)Producer_topic_new, METH_VARARGS|METH_KEYWORDS,
"Creates a new topic handle for topic named topic, allows setting a per-topic configuration\n"
Copy link

Choose a reason for hiding this comment

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

Doesn't this need a function signature in the doc?:

          ".. py:function:: topic_new(topic, [conf])\n\n"

nit: The standard in the codebase seems to be using config rather than conf.

Copy link

@bisho bisho left a comment

Choose a reason for hiding this comment

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

LG!

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.

2 participants