ShannonDing commented on a change in pull request #102: [API]Add Order Async 
Send API(C) and example
URL: 
https://github.com/apache/rocketmq-client-cpp/pull/102#discussion_r266307159
 
 

 ##########
 File path: src/extern/CProducer.cpp
 ##########
 @@ -196,6 +196,36 @@ int SendMessageOneway(CProducer *producer, CMessage *msg) 
{
     return OK;
 }
 
+int
+SendMessageOrderlyAsync(CProducer *producer,
+            CMessage *msg,
+            QueueSelectorCallback callback,
+            void *arg,
+            CSendSuccessCallback cSendSuccessCallback,
+            CSendExceptionCallback cSendExceptionCallback                    
+                    ) {
+    if (producer == NULL || msg == NULL || callback == NULL || 
cSendSuccessCallback == NULL || cSendExceptionCallback == NULL) {
+        return NULL_POINTER;
+    }
+    DefaultMQProducer *defaultMQProducer = (DefaultMQProducer *) producer;
+    MQMessage *message = (MQMessage *) msg;
+        CSendCallback* cSendCallback = new CSendCallback(cSendSuccessCallback 
, cSendExceptionCallback);
+
+    try {
+        //Constructing SelectMessageQueue objects through function pointer 
callback
+        SelectMessageQueue selectMessageQueue(callback);
+        defaultMQProducer->send(*message,
+         &selectMessageQueue, arg,cSendCallback);
+    } catch (exception &e) {
+        printf("%s\n",e.what());
 
 Review comment:
   It is better to remove the standard output.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to