You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/05/11 03:52:54 UTC
[GitHub] [rocketmq-client-python] Heisenberg2017 opened a new issue, #127: readme example consumer.shutdown() is unreachable
Heisenberg2017 opened a new issue, #127:
URL: https://github.com/apache/rocketmq-client-python/issues/127
**BUG REPORT**
consumer.shutdown() is unreachable :
`import time
from rocketmq.client import PushConsumer, ConsumeStatus
def callback(msg):
print(msg.id, msg.body)
return ConsumeStatus.CONSUME_SUCCESS
consumer = PushConsumer('CID_XXX')
consumer.set_name_server_address('127.0.0.1:9876')
consumer.subscribe('YOUR-TOPIC', callback)
consumer.start()
while True:
time.sleep(3600)
consumer.shutdown() # <- _This code is unreachable_
`
maybe can be changed to
`
try:
while True:
time.sleep(3600)
except KeyboardInterrupt:
consumer.shutdown()
`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-client-python] miner-k commented on issue #127: readme example consumer.shutdown() is unreachable
Posted by "miner-k (via GitHub)" <gi...@apache.org>.
miner-k commented on issue #127:
URL: https://github.com/apache/rocketmq-client-python/issues/127#issuecomment-1458132146
you should create a class, `consumer.shutdown()` as new function of the class
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-client-python] shane965 commented on issue #127: readme example consumer.shutdown() is unreachable
Posted by "shane965 (via GitHub)" <gi...@apache.org>.
shane965 commented on issue #127:
URL: https://github.com/apache/rocketmq-client-python/issues/127#issuecomment-1463195900
> you should create a class, `consumer.shutdown()` as new function of the class
Thank you for your reply. I will try it when I have time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-client-python] shane965 closed issue #127: readme example consumer.shutdown() is unreachable
Posted by "shane965 (via GitHub)" <gi...@apache.org>.
shane965 closed issue #127: readme example consumer.shutdown() is unreachable
URL: https://github.com/apache/rocketmq-client-python/issues/127
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org