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 2021/10/21 01:20:41 UTC

[GitHub] [rocketmq-client-python] turkeymz opened a new issue #117: The producer group has been created before, specify another name please.

turkeymz opened a new issue #117:
URL: https://github.com/apache/rocketmq-client-python/issues/117


   I am using rocketmq in the flash application.
   But when the application wants to send a message the second time, it meets this exeception
   **The producer group has been created before, specify another name please.**
   
   Here is my code:
   from rocketmq.client import Producer, Message
   import json
   import uuid
   from config import Config
   
   def send_message(message):
       '''
       发送消息队列
       :param message: 消息体,必须是字典或json格式
       :return:
       '''
       group = Config.getConfig().MSG_GROUP
       # group = str(uuid.uuid4())
       topic = Config.getConfig().MSG_GROUP
       addr = Config.getConfig().MSG_ADDR
       producer = Producer(group)
   
       producer.set_namesrv_addr(addr)  # rocketmq队列接口地址(服务器ip:port)
       producer.start()
   
       msg = Message(topic)
       msg.set_tags('python_compare_tag')
       msg.set_body(str(json.dumps(message)))
   
       producer.send_sync(msg)
       producer.shutdown()
   
   Question:
   1. Does the app need to create a new group every time?
   2. If not, how should I change the code to solve this execption?
   3. Does rocketmq has some framework with flask app?
   
   
   
   


-- 
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] ifplusor commented on issue #117: The producer group has been created before, specify another name please.

Posted by GitBox <gi...@apache.org>.
ifplusor commented on issue #117:
URL: https://github.com/apache/rocketmq-client-python/issues/117#issuecomment-966015246


   Use same producer instance for same cluster.


-- 
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