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.
70 lines
2.4 KiB
70 lines
2.4 KiB
#ifndef __KERNEL_KAFKA_MODULE_HEADERS__
|
|
#define __KERNEL_KAFKA_MODULE_HEADERS__
|
|
|
|
#include "../components/base/basicEventHeap.h"
|
|
#include "../components/base/basicThread.h"
|
|
#include "../data/protocol/protocolKAFKA.h"
|
|
#include "kernelModule.h"
|
|
|
|
// #define SIMULATOR
|
|
// #define KAFKA_DUMMY_SEND
|
|
|
|
#define KAFKA_TPL_SUBST_ID "%%ID%%"
|
|
#define KAFKA_TPL_SUBST_UUID "%%UUID%%"
|
|
#define KAFKA_TPL_SUBST_TS "%%TIMESTAMP%%"
|
|
#define KAFKA_TPL_SUBST_AZ "%%AZIMUTH%%"
|
|
#define KAFKA_TPL_SUBST_RANGE "%%RANGE%%"
|
|
#define KAFKA_TPL_SUBST_EL "%%ELEVATION%%"
|
|
#define KAFKA_TPL_SUBST_WIDTH "%%WIDTH%%"
|
|
#define KAFKA_TPL_SUBST_LON "%%LON%%"
|
|
#define KAFKA_TPL_SUBST_LAT "%%LAT%%"
|
|
#define KAFKA_TPL_SUBST_ALT "%%ALT%%"
|
|
#define KAFKA_TPL_SUBST_EXEVTD "%%EXEVTID%%"
|
|
#define KAFKA_TPL_SUBST_SRC_LON "%%SRC_LON%%"
|
|
#define KAFKA_TPL_SUBST_SRC_LAT "%%SRC_LAT%%"
|
|
#define KAFKA_TPL_SUBST_SRC_ALT "%%SRC_ALT%%"
|
|
#define KAFKA_TPL_SUBST_SRC_ROT_X "%%SRC_ROT_X%%"
|
|
#define KAFKA_TPL_SUBST_SRC_ROT_Y "%%SRC_ROT_Y%%"
|
|
#define KAFKA_TPL_SUBST_SRC_ROT_Z "%%SRC_ROT_Z%%"
|
|
#define KAFKA_TPL_SUBST_SRC_IP "%%SRC_IP%%"
|
|
#define KAFKA_TPL_SUBST_SRV_IP "%%SRV_IP%%"
|
|
#define KAFKA_TPL_SUBST_SRV_NAME "%%SRV_NAME%%"
|
|
#define KAFKA_TPL_SUBST_SRC_NAME "%%SRC_NAME%%"
|
|
#define KAFKA_TPL_SUBST_MSG_UUID "%%MUID%%"
|
|
|
|
#define FH_DEFAULT_JAMING_TIME 10
|
|
|
|
class kernelModuleKafka : public kernelModule, public basicThread
|
|
{
|
|
private:
|
|
|
|
KAFKA_SETTINGS * m_pSettings;
|
|
protocolKAFKA * m_pProtocol;
|
|
bool m_bConsumerEnabled;
|
|
basicEventHeap * m_pEventHeap;
|
|
KAFKA_TEMPLATE *** m_pEvtTemplates;
|
|
|
|
int32_t partition;
|
|
int64_t start_offset;
|
|
char m_sServerIP[48];
|
|
char m_sServerName[48];
|
|
unsigned long long m_llTicks;
|
|
CSTR buildTemplate(CSTR tpl, uint32_t source_id, CSTR ts, CSTR uuid = NULL, CSTR az = NULL, CSTR range = NULL, CSTR width = NULL, CSTR el = NULL, CSTR lat = NULL, CSTR lon = NULL, CSTR alt = NULL, CSTR extID = NULL, CSTR src_Name = NULL,
|
|
CSTR src_IP = NULL, CSTR src_lat = NULL, CSTR src_lon = NULL, CSTR src_alt = NULL, CSTR src_rot_x = NULL, CSTR src_rot_y = NULL, CSTR src_rot_z = NULL);
|
|
|
|
protected:
|
|
|
|
virtual void m_fThreadProc(void);
|
|
|
|
public:
|
|
|
|
explicit kernelModuleKafka(uint32_t ModuleID);
|
|
virtual ~kernelModuleKafka();
|
|
|
|
virtual bool reloadSettings();
|
|
virtual bool startService();
|
|
virtual bool stopService(bool force = false);
|
|
virtual bool dispatchEvent(EVENT_CONTAINER * Evt);
|
|
};
|
|
|
|
#endif
|