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/08/24 10:21:28 UTC

[GitHub] [rocketmq-client-python] Zzaniu commented on issue #114: I use this producer example to send transaction message to RocketMQ, why the check_callback callback function cannot execute?

Zzaniu commented on issue #114:
URL: https://github.com/apache/rocketmq-client-python/issues/114#issuecomment-904515772


   1.rocketmq-client-python == 2.0.0
   2.on_check callback function not execute
   
   def test_transaction_producer():
       stop_event = threading.Event()
       msg_body = 'XXXX'
   
       def on_local_execute(msg, user_args):
           return TransactionStatus.UNKNOWN
   
       def on_check(msg):
           stop_event.set()
           assert msg.body.decode('utf-8') == msg_body
           return TransactionStatus.COMMIT
   
       producer = TransactionMQProducer('transactionTestGroup' + str(PY_VERSION), on_check)
       producer.set_name_server_address('127.0.0.1:9876')
       producer.start()
       msg = Message('test')
       msg.set_keys('transaction')
       msg.set_tags('XXX')
       msg.set_body(msg_body)
       producer.send_message_in_transaction(msg, on_local_execute)
       while not stop_event.is_set():
           time.sleep(2)
       producer.shutdown()
   
   ![image](https://user-images.githubusercontent.com/37571303/130600425-f35c2080-70c4-499c-886c-c74ae99c9b30.png)
   


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