-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
28 lines (22 loc) · 849 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "LogEntrySerializer.h"
#include <glog/logging.h>
#include <iostream>
#include <zmq_addon.hpp>
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define __CODE_POINT__ (__FILE__ "::" STR(__LINE__))
int main() {
for (int j = 0; j < 5; ++j) {
zmq::context_t context(1);
zmq::socket_t brokerA(context, zmq::socket_type::push);
brokerA.connect("tcp://localhost:52236");
LOG(INFO) << "Connected to socket";
for (int i = 0; i < 5; ++i) {
LogEntrySerializer log_to_send(Logger::LogLevel::INSANE, __CODE_POINT__, "hello from msg " + std::to_string(i), "this service", "hostname");
log_to_send.export_fb();
brokerA.send(zmq::const_buffer(zmq::buffer(log_to_send.get_data())), zmq::send_flags::dontwait);
}
brokerA.close();
}
return 0;
}