[GitHub] merlimat commented on a change in pull request #2451: Issue 2312: add python client multi-topics consumer support

2018-08-27 Thread GitBox
merlimat commented on a change in pull request #2451: Issue 2312: add python 
client multi-topics consumer support
URL: https://github.com/apache/incubator-pulsar/pull/2451#discussion_r213042192
 
 

 ##
 File path: pulsar-client-cpp/python/pulsar_test.py
 ##
 @@ -650,6 +650,110 @@ def _v2_topics(self, url):
 
 client.close()
 
+def test_topics_consumer(self):
+client = Client(self.serviceUrl)
+topic1 = 
'persistent://sample/standalone/ns/my-python-topics-consumer-1'
+topic2 = 
'persistent://sample/standalone/ns/my-python-topics-consumer-2'
+topic3 = 
'persistent://sample/standalone/ns/my-python-topics-consumer-3'
+topics = [topic1, topic2, topic3]
+
+url1 = self.adminUrl + 
'/admin/persistent/sample/standalone/ns/my-python-topics-consumer-1/partitions'
+url2 = self.adminUrl + 
'/admin/persistent/sample/standalone/ns/my-python-topics-consumer-2/partitions'
+url3 = self.adminUrl + 
'/admin/persistent/sample/standalone/ns/my-python-topics-consumer-3/partitions'
+
+doHttpPut(url1, '2')
+doHttpPut(url2, '3')
+doHttpPut(url3, '4')
 
 Review comment:
   As I mentioned in #2448, I think the multi-topic consumer in C++ is 
currently not working when there are no partitions in the topic.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] merlimat commented on a change in pull request #2451: Issue 2312: add python client multi-topics consumer support

2018-08-27 Thread GitBox
merlimat commented on a change in pull request #2451: Issue 2312: add python 
client multi-topics consumer support
URL: https://github.com/apache/incubator-pulsar/pull/2451#discussion_r213041782
 
 

 ##
 File path: pulsar-client-cpp/python/pulsar/__init__.py
 ##
 @@ -503,6 +503,211 @@ def my_listener(consumer, message):
 self._consumers.append(c)
 return c
 
+def subscribe_topics(self, topics, subscription_name,
 
 Review comment:
   @jiazhai I'd prefer to keep a single `subscribe()` method. In python we can 
check the type of the argument `topic` and detect whether is a string, a list 
or a regex object.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services