You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
729 B
36 lines
729 B
1 year ago
|
|
||
|
#ifndef CSCI_CONTROLLER_H
|
||
|
#define CSCI_CONTROLLER_H
|
||
|
|
||
|
#include <QString>
|
||
|
#include <QObject>
|
||
|
|
||
|
#include "../../handler/kafka_handler.h"
|
||
|
|
||
|
class Controller : public QObject {
|
||
|
|
||
|
public:
|
||
|
|
||
|
virtual const QString className() const {
|
||
|
return "Controller";
|
||
|
}
|
||
|
|
||
|
virtual void route(const QString& key, const QString& message){}
|
||
|
|
||
|
/**
|
||
|
* 发送消息
|
||
|
* @param topic 消息话题
|
||
|
* @param message
|
||
|
* @param key
|
||
|
* @param headers
|
||
|
*/
|
||
|
void message(const QString& topic, const QString& message, const QString& key = nullptr,
|
||
|
RdKafka::Headers *headers = RdKafka::Headers::create()){
|
||
|
KafkaHandler::message(topic,message,key,headers);
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //CSCI_CONTROLLER_H
|