#pragma once #include "RabbitmqClient.h" #include "ExecTask.h" class RabbitmqTask:public ExecTask { public: RabbitmqTask(); ~RabbitmqTask(); int Connect(const std::string &strHostname, int iPort, const std::string &strUser, const std::string &strPasswd); int Consumer(const std::string &strQueueName); private: /*虚函数重写*/ void onConsumChange(const bool&bConsum) override; /*消息接收函数回调*/ void onRecvCB(const std::string& strMessage); private: std::unique_ptr m_pRabbit; };