duhengforever closed pull request #5: add C-API SendMessageOneway
URL: https://github.com/apache/rocketmq-client-cpp/pull/5
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/include/CProducer.h b/include/CProducer.h
index 09f4a0b..c8bd029 100644
--- a/include/CProducer.h
+++ b/include/CProducer.h
@@ -47,7 +47,7 @@ int SetProducerCompressLevel(CProducer *producer, int level);
 int SetProducerMaxMessageSize(CProducer *producer, int size);
 
 int SendMessageSync(CProducer *producer, CMessage *msg, CSendResult *result);
-
+int SendMessageOneway(CProducer *producer,CMessage *msg);
 #ifdef __cplusplus
 };
 #endif
diff --git a/src/extern/CProducer.cpp b/src/extern/CProducer.cpp
index 4ac683b..0bf307a 100644
--- a/src/extern/CProducer.cpp
+++ b/src/extern/CProducer.cpp
@@ -93,6 +93,16 @@ int SendMessageSync(CProducer *producer, CMessage *msg, 
CSendResult *result) {
     return OK;
 }
 
+int SendMessageOneway(CProducer *producer,CMessage *msg) {
+    if (producer == NULL || msg == NULL) {
+        return NULL_POINTER;
+    }
+    DefaultMQProducer *defaultMQProducer = (DefaultMQProducer *) producer;
+    MQMessage *message = (MQMessage *) msg;
+    defaultMQProducer->sendOneway(*message);
+    return OK;
+}
+
 int SetProducerGroupName(CProducer *producer, const char *groupName) {
     if (producer == NULL) {
         return NULL_POINTER;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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