61 lines
1.9 KiB
C++
61 lines
1.9 KiB
C++
|
|
#ifdef __cplusplus
|
|
#include "../json/mms_json_inter.h"
|
|
#include "../include/rocketmq/CProducer.h"
|
|
#include "../include/rocketmq/CMessage.h"
|
|
#include "../include/rocketmq/CSendResult.h"
|
|
|
|
#include "../include/rocketmq/CPushConsumer.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
/*添加测试函数lnk10-10*/
|
|
void producer_send0();
|
|
void StartSendMessage(CProducer* producer,const char* strbody);
|
|
void producer_send(const char* strbody);
|
|
void rocketmq_producer_send(const char* strbody,const char* topic);
|
|
void rocketmq_StartSendMessage(CProducer* producer,const char* strbody,const char* topic);
|
|
extern "C" {
|
|
void rocketmq_test_rt();
|
|
void rocketmq_test_ud();
|
|
void rocketmq_test_rc();
|
|
void rocketmq_test_log();
|
|
void rocketmq_test_set();
|
|
void rocketmq_test_only();
|
|
void rocketmq_test_300(int mpnum,int front_index);
|
|
}
|
|
//void rocketmq_test_300(int mpnum,int front_index);//20241202lnk
|
|
extern void my_rocketmq_send(Ckafka_data_t& data);
|
|
extern int parse_device_web_test_ext();
|
|
extern int parse_device_web_test_dev();
|
|
|
|
|
|
///////////////////////////////////////////////////////生产者
|
|
void InitializeProducer();
|
|
void ShutdownAndDestroyProducer();
|
|
//////////////////////////////////////////////////////消费者
|
|
void InitializeConsumer(const std::string& consumerName, const std::string& nameServer, const char* topic, const char* tag, const std::string& key);
|
|
void ShutdownAndDestroyConsumer();
|
|
|
|
struct Subscription {
|
|
std::string topic;
|
|
std::string tag;
|
|
MessageCallBack callback;
|
|
|
|
Subscription(const std::string& t, const std::string& tg, MessageCallBack cb)
|
|
: topic(t), tag(tg), callback(cb) {}
|
|
};
|
|
|
|
void rocketmq_consumer_receive(
|
|
const std::string& consumerName,
|
|
const std::string& nameServer,
|
|
//const std::string& topic,
|
|
//const std::string& tag,
|
|
//MessageCallBack callback);
|
|
const std::vector<Subscription>& subscriptions);
|
|
|
|
//////////////////////////////////////////////////////
|
|
#endif
|
|
//////////////////////////////////////////////////////
|