You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
def test_push_consumer_reconsume_later():
stop_event = threading.Event()
raised_exc = threading.Event()
def on_message(msg):
print(msg.body.decode('utf-8'))
if not raised_exc.is_set():
raised_exc.set()
raise Exception('Should reconsume later')
stop_event.set()
consumer = PushConsumer('xxxx')
consumer.set_namesrv_domain('http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet')
# For ip and port name server address, use `set_namesrv_addr` method, for example:
# consumer.set_namesrv_addr('127.0.0.1:9887')
consumer.set_session_credentials('LTAI0Dl0VYPDiExz', 'KOFlHDMPlVboJPbBcy07wkGO6rRyeB',
'ALIYUN') # No need to call this function if you don't use Aliyun.
consumer.subscribe('xxxxx', on_message, 'hello')
consumer.start()
while not stop_event.is_set():
time.sleep(10)
test_push_consumer_reconsume_later()