Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A process is launched within the callback function, and an error occurs when attempting to send an MQ message within that process. #147

Open

Description

i write a code like that:

) print(' [Consumer] Waiting for messages.') consumer.start() while True: time.sleep(1) def start_pro(): producer = Producer('test_producer') producer.set_name_server_address('10.13.2.12:9876') producer.start() try: event = {"aa": "vv", "bb": 33} msg = Message("fireMsg") ss = json.dumps(event).encode('utf-8') msg.set_body(ss) producer.send_sync(msg) finally: producer.shutdown() def send_message(): i = Process(target=start_pro) i.start() return ConsumeStatus.CONSUME_SUCCESS if __name__ == '__main__': rmq_con = Process(target=rmq_consumer)

The code snippet "'producer.send_sync(msg)'"
throws an error
"rocketmq.exceptions.ProducerSendSyncFailed: No route info of this topic: fireMsg,error:-1,in file rocketmq-client-cpp/src/producer/DefaultMQProducerImpl.cpp line:434"

What could be the cause of this? My RocketMQ deployment is functioning normally.

If I don't execute Process(target=start_pro) within the send_message method and instead directly include the contents of start_pro within send_message, the aforementioned error does not occur.

Looking forward to your response. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /