
#ifdef __cplusplus
#include "../json/mms_json_inter.h"
//#include "../rocketmq/CProducer.h"
//#include "../rocketmq/CMessage.h"
//#include "../rocketmq/CSendResult.h"
//#include "../rocketmq/CPushConsumer.h"
#include "../rocketmq/DefaultMQProducer.h"
#include "../rocketmq/MQMessage.h"
#include "../rocketmq/SendResult.h"
#include "../rocketmq/SessionCredentials.h"
#include "../rocketmq/MQMessageExt.h"
#include "../rocketmq/ConsumeType.h"
#include "../rocketmq/MQMessageListener.h"

#include <vector>
#include <iostream>
#include <string>

using namespace rocketmq;

/*添加测试函数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);
void rocketmq_producer_send(const std::string& body,
                            const std::string& topic,
                            const std::string& tags,
                            const std::string& keys);
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,int type);
}
extern void my_rocketmq_send(Ckafka_data_t& data);


///////////////////////////////////////////////////////生产者
void InitializeProducer();
void ShutdownAndDestroyProducer();
//////////////////////////////////////////////////////消费者
typedef ConsumeStatus (*MessageCallBack)(
    const MQMessageExt& msg
);

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 InitializeConsumer(const std::string& consumerName, const std::string& nameServer, const char* topic, const char* tag, const std::string& key);
void InitializeConsumer(const std::string& consumerName,
                        const std::string& nameServer,
                        const std::vector<Subscription>& subscriptions);
void ShutdownAndDestroyConsumer();

void rocketmq_consumer_receive(
    const std::string& consumerName,
    const std::string& nameServer,
    const std::vector<Subscription>& subscriptions);

//////////////////////////////////////////////////////
#endif
//////////////////////////////////////////////////////
