apache / apache/rocketmq-client-python

如何让消费者并发消费?

Open
#146 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
305
Forks
98
PR merge metrics
No merged PRs in 30d

Description

def createConsumer():
consumer = PushConsumer(gid) # 指定group-id
consumer.set_namesrv_addr(name_srv) # rocketmq队列接口地址(服务器ip:port)
consumer.subscribe(topic, callback) # 订阅
consumer.start() # 开启
if __name__=='__main__':
print('Parent process %s.' % os.getpid())
for i in range(5):
p = Process(target=createConsumer)
print('Run child process (%s)...' % (os.getpid()))
p.start()
while True:
time.sleep(3600)
为什么我写了多进程的消费程序,但是却并不执行

Contributor guide

Open the contributing guide

Research direction

Start with the shown createConsumer function and the loop that starts five multiprocessing.Process instances. Inspect the Python client’s PushConsumer startup and callback path, then reproduce the reported non-execution. Done means identifying why the consumers do not run and confirming the explanation or fix with a working concurrent consumer example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.