apache / apache/rocketmq-client-python
如何让消费者并发消费?
Aperta
- Lingua principale
- Python
- Stelle
- 305
- Fork
- 98
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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)
为什么我写了多进程的消费程序,但是却并不执行
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.