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

Python pulsar-client lacks multi-topic support #2033

Closed
georgewilk01 opened this issue Jun 26, 2018 · 7 comments
Closed

Python pulsar-client lacks multi-topic support #2033

georgewilk01 opened this issue Jun 26, 2018 · 7 comments
Labels
deprecated/question Questions should happened in GitHub Discussions doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.

Comments

@georgewilk01
Copy link

Expected behavior

According to documentation, post 1.7 API supports multi-topic subscriptions via regx and list.

Actual behavior

I am unable to subscribe to a limited list of topics in my namespace using python client for pulsar with regx.

Steps to reproduce

Post message using command line as follows:
bin/pulsar-client produce my-topic.1 --messages "user created"

Subscribe consumer written in python as follows:

import pulsar

msg_address = "pulsar://localhost:6650/" 

client = pulsar.Client(msg_address)
consumer = client.subscribe('my-topic.*', 'my-subscription')

while True:
    msg = consumer.receive(timeout_millis=30000)
    print("Received message '{}' id='{}'".format(msg.data(), msg.message_id()))
    consumer.acknowledge(msg)

client.close()

System configuration

Pulsar version: apache-pulsar-2.0.1-incubating

@merlimat
Copy link
Contributor

@georgewilk01 The multi-topic / regex subscribe for C++/Python client lib is currently being worked on and it's planned for 2.2 release. (PR at #1996 ) There are other newer features that got first introduced in Java client and we're now porting them to C++ (and wrappers). There's a github project here: https://github.com/apache/incubator-pulsar/projects/7 and we'll be adding a feature comparison matrix across all languages.

@georgewilk01
Copy link
Author

Thank you for the info, @merlimat.

@merlimat
Copy link
Contributor

@sijie sijie added triage/week-26 deprecated/question Questions should happened in GitHub Discussions doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. labels Jun 27, 2018
@sijie
Copy link
Member

sijie commented Sep 19, 2018

multi-topic and regex subscription support is added to python. it is actually released in 2.1.1 and will also be in 2.2.0

@sijie sijie closed this as completed Sep 19, 2018
@Vanlightly
Copy link
Contributor

Hi, I am using the 2.2.0 Python client and I don't have multi-topic or regex subscription support still. Am I missing something?

@merlimat
Copy link
Contributor

merlimat commented Nov 4, 2018

@Vanlightly the subscribe() method can take a list of topics or a regex in the new version: http://pulsar.apache.org/api/python/#pulsar.Client.subscribe

@Vanlightly
Copy link
Contributor

Thanks @merlimat, I missed that Python API page. It is working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated/question Questions should happened in GitHub Discussions doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.
Projects
None yet
Development

No branches or pull requests

4 participants