Commit 5faab7bf by Amir Aharon

first copiling version

parent 4cbd20fb
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
"${workspaceRoot}/src", "${workspaceRoot}/src",
"/usr/include/c++/7.4.0", "/usr/include/c++/7.4.0",
"/usr/include/x86_64-linux-gnu/c++/7.4.0", "/usr/include/x86_64-linux-gnu/c++/7.4.0",
"${workspaceRoot}/../3party/cereal/include" "${workspaceRoot}/../3party/cereal/include",
"${workspaceRoot}/../3party/spdlog/include"
], ],
"compileCommands": "./compile_commands.json", "compileCommands": "./compile_commands.json",
"defines": [], "defines": [],
......
...@@ -20,7 +20,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) ...@@ -20,7 +20,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set ( PROJECT_LINK_LIBS -lPocoFoundation -ljson -lhiredis -lcpprest -lcppmetrics -lboost_random -lboost_timer -lboost_chrono set ( PROJECT_LINK_LIBS -lPocoFoundation -ljson -lhiredis -lcpprest -lcppmetrics -lboost_random -lboost_timer -lboost_chrono
-lboost_system -lboost_thread -lboost_date_time -lboost_regex -lboost_filesystem -lpthread -lboost_system -lboost_thread -lboost_date_time -lboost_regex -lboost_filesystem -lpthread
-lboost_random -lboost_chrono -lboost_system -lboost_thread -lssl -lboost_random -lboost_chrono -lboost_system -lboost_thread -lssl
-lcrypto -llog4cpp -lglog -lzmqpp -lzmq -levpp -levent) -lcrypto -lzmqpp -lzmq -levpp -levent)
# set ( PROJECT_LINK_LIBS -lPocoFoundation -ljson -lhiredis -lcpprest -lcppmetrics -lboost_random -lboost_timer -lboost_chrono # set ( PROJECT_LINK_LIBS -lPocoFoundation -ljson -lhiredis -lcpprest -lcppmetrics -lboost_random -lboost_timer -lboost_chrono
# -lboost_system -lboost_thread -lboost_date_time -lboost_regex -lboost_filesystem -lpthread # -lboost_system -lboost_thread -lboost_date_time -lboost_regex -lboost_filesystem -lpthread
...@@ -36,12 +36,12 @@ include_directories(SYSTEM ../3party/rapidjson-cereal-1.2.1) ...@@ -36,12 +36,12 @@ include_directories(SYSTEM ../3party/rapidjson-cereal-1.2.1)
#include_directories(SYSTEM ../3party/rapidjson-0.11/include/rapidjson) #include_directories(SYSTEM ../3party/rapidjson-0.11/include/rapidjson)
include_directories(SYSTEM ../3party/cppmetrics-0.1.1-Linux/include) include_directories(SYSTEM ../3party/cppmetrics-0.1.1-Linux/include)
include_directories(SYSTEM ../3party/civetweb/include) include_directories(SYSTEM ../3party/civetweb/include)
include_directories(SYSTEM ../3party/cpprest/Release/include) #include_directories(SYSTEM ../3party/cpprest/Release/include)
include_directories(SYSTEM ../3party/rabbitmq) include_directories(SYSTEM ../3party/rabbitmq)
include_directories(SYSTEM ../3party/flatbuffers/include) include_directories(SYSTEM ../3party/flatbuffers/include)
include_directories(SYSTEM ../3party/poco-1.7.8/Foundation/include) #include_directories(SYSTEM ../3party/poco-1.7.8/Foundation/include)
include_directories(SYSTEM ../3party/evpp/build-release/include) include_directories(SYSTEM ../3party/evpp/build-release/include)
include_directories(SYSTEM ../3party/spdlog/include/spdlog) include_directories(SYSTEM ../3party/spdlog/include)
# include_directories(SYSTEM ../internals/include/Rabbitmq) # include_directories(SYSTEM ../internals/include/Rabbitmq)
include_directories(SYSTEM /usr/include/Poco) include_directories(SYSTEM /usr/include/Poco)
include_directories(SYSTEM /usr/include/hiredis) include_directories(SYSTEM /usr/include/hiredis)
...@@ -56,13 +56,16 @@ get_filename_component(RMQRequest_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl ...@@ -56,13 +56,16 @@ get_filename_component(RMQRequest_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl
get_filename_component(RMQResponse_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/Microservice_IResponseRMQImpl.cpp ABSOLUTE) get_filename_component(RMQResponse_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/Microservice_IResponseRMQImpl.cpp ABSOLUTE)
get_filename_component(RMQServer_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/servers/Microservice_IRestServerRMQImpl.cpp ABSOLUTE) get_filename_component(RMQServer_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/servers/Microservice_IRestServerRMQImpl.cpp ABSOLUTE)
get_filename_component(RMQClient_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/clients/MSICommandClientRMQImpl.cpp ABSOLUTE) get_filename_component(RMQClient_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/clients/MSICommandClientRMQImpl.cpp ABSOLUTE)
get_filename_component(LOG4Cpp_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/Microservices_ILoggerLog4cppImpl.cpp ABSOLUTE)
message("${RMQHandler_file_path}") message("${RMQHandler_file_path}")
list(REMOVE_ITEM SOURCES "${RMQHandler_file_path}" list(REMOVE_ITEM SOURCES "${RMQHandler_file_path}"
"${RMQRequest_file_path}" "${RMQRequest_file_path}"
"${RMQResponse_file_path}" "${RMQResponse_file_path}"
"${RMQServer_file_path}" "${RMQServer_file_path}"
"${RMQClient_file_path}") "${RMQClient_file_path}"
"${LOG4Cpp_file_path}")
message("${SOURCES}") message("${SOURCES}")
#Generate the shared library from the sources #Generate the shared library from the sources
...@@ -137,7 +140,7 @@ INSTALL( DIRECTORY ../3party/rapidjson-cereal-1.2.1 DESTINATION include/3party ) ...@@ -137,7 +140,7 @@ INSTALL( DIRECTORY ../3party/rapidjson-cereal-1.2.1 DESTINATION include/3party )
INSTALL( DIRECTORY ../3party/cppmetrics-0.1.1-Linux/include DESTINATION include/3party/cppmetrics ) INSTALL( DIRECTORY ../3party/cppmetrics-0.1.1-Linux/include DESTINATION include/3party/cppmetrics )
file (GLOB INSTALL_FILES "../3party/mongoose/mongoose.*") file (GLOB INSTALL_FILES "../3party/mongoose/mongoose.*")
install(FILES ${INSTALL_FILES} DESTINATION include/3party/mongoose) install(FILES ${INSTALL_FILES} DESTINATION include/3party/mongoose)
INSTALL( DIRECTORY ../3party/cpprest/Release/include DESTINATION include/3party/cpprest ) #INSTALL( DIRECTORY ../3party/cpprest/Release/include DESTINATION include/3party/cpprest )
INSTALL( DIRECTORY ../3party/evpp/build-release/include DESTINATION include/3party/evpp ) INSTALL( DIRECTORY ../3party/evpp/build-release/include DESTINATION include/3party/evpp )
INSTALL( DIRECTORY ../3party/rabbitmq DESTINATION include/3party ) INSTALL( DIRECTORY ../3party/rabbitmq DESTINATION include/3party )
#INSTALL( DIRECTORY ../internals/include/Rabbitmq DESTINATION include/internals ) #INSTALL( DIRECTORY ../internals/include/Rabbitmq DESTINATION include/internals )
......
...@@ -9,4 +9,5 @@ ...@@ -9,4 +9,5 @@
# libgoogle-glog-dev libboost-all-dev libssl-dev uuid-dev libzmqpp-dev libmhash-dev libevent-dev # libgoogle-glog-dev libboost-all-dev libssl-dev uuid-dev libzmqpp-dev libmhash-dev libevent-dev
apt-get install -y libhiredis-dev libzmq3-dev liblog4cpp5-dev \ apt-get install -y libhiredis-dev libzmq3-dev liblog4cpp5-dev \
libgoogle-glog-dev libboost-all-dev libssl-dev uuid-dev libzmqpp-dev libmhash-dev libevent-dev libgoogle-glog-dev libboost-all-dev libssl-dev uuid-dev libzmqpp-dev libmhash-dev libevent-dev \
\ No newline at end of file libpoco-dev libcpprest-dev
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <handlers/Microservice_MonitorHandler.h> #include <handlers/Microservice_MonitorHandler.h>
#include <algorithm> #include <algorithm>
#include <Microservice_Client.h> #include <Microservice_Client.h>
#include <impl/Microservices_ILoggerLog4cppImpl.h> #include <impl/Microservice_ILoggerSpdlogImpl.h>
#include <impl/Microservice_IConfigurationConfigPropImpl.h> #include <impl/Microservice_IConfigurationConfigPropImpl.h>
#include <chrono> #include <chrono>
#include <condition_variable> #include <condition_variable>
...@@ -269,7 +269,8 @@ Microservice_App& Microservice_App::build() { ...@@ -269,7 +269,8 @@ Microservice_App& Microservice_App::build() {
// init default logger if there is none // init default logger if there is none
if (mpc_Logger == nullptr) if (mpc_Logger == nullptr)
mpc_Logger = new cMicroservices_ILoggerLog4cppImpl(mc_AppName.c_str()); // default logger //mpc_Logger = new cMicroservices_ILoggerLog4cppImpl(mc_AppName.c_str()); // default logger
mpc_Logger = new Microservice_ILoggerSpdlogImpl(mc_AppName.c_str()); // default logger
/* /*
......
#include "Microservice_ILoggerSpdlogImpl.h" #include "Microservice_ILoggerSpdlogImpl.h"
#include "spdlog/sinks/stdout_color_sinks.h" #include <spdlog/sinks/stdout_color_sinks.h>
thread_local char ba_LogBuffer[nsMicroservice_Constants::MAX_LOGEER_BUFF_LENGTH];
#define MAKE_MESSAGE {int len; va_list ap; va_start( ap , stringFormat );\ #define MAKE_MESSAGE {int len; va_list ap; va_start( ap , stringFormat );\
len = ( vsnprintf(ba_LogBuffer, nsMicroservice_Constants::MAX_LOGEER_BUFF_LENGTH, stringFormat, ap ) ); va_end(ap);} len = ( vsnprintf(ba_LogBuffer, nsMicroservice_Constants::MAX_LOGEER_BUFF_LENGTH, stringFormat, ap ) ); va_end(ap);}
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
// #include <impl/clients/MSICommandClientRMQImpl.h> // #include <impl/clients/MSICommandClientRMQImpl.h>
#include "impl/Microservices_ILoggerLog4cppImpl.h"
#include <utils/ClientFactory.h> #include <utils/ClientFactory.h>
#include <utils/CommonUtils.h> #include <utils/CommonUtils.h>
#include <flatbuffers/flatbuffers.h> #include <flatbuffers/flatbuffers.h>
...@@ -572,12 +571,12 @@ void runMSClientEvppTest(){ ...@@ -572,12 +571,12 @@ void runMSClientEvppTest(){
static int responsed = 0; static int responsed = 0;
static void HandleHTTPResponse(const std::shared_ptr<evpp::httpc::EvppResponse>& response, evpp::httpc::PostEvppRequest* request) { static void HandleHTTPResponse(const std::shared_ptr<evpp::httpc::EvppResponse>& response, evpp::httpc::PostEvppRequest* request) {
LOG_INFO << "http_code=" << response->http_code() std::cout << "http_code=" << response->http_code()
<< " URL=http://" << request->host() << request->uri() << " URL=http://" << request->host() << request->uri()
<< " BODY = [" << response->body().ToString() << "]"; << " BODY = [" << response->body().ToString() << "]";
const char* header = response->FindHeader("Connection"); const char* header = response->FindHeader("Connection");
if (header) { if (header) {
LOG_INFO << "HTTP HEADER Connection=" << header; std::cout << "HTTP HEADER Connection=" << header;
} }
responsed++; responsed++;
assert(request == response->request()); assert(request == response->request());
...@@ -601,7 +600,7 @@ void test_evpp(){ ...@@ -601,7 +600,7 @@ void test_evpp(){
} }
t.Stop(true); t.Stop(true);
LOG_INFO << "EventLoopThread stopped."; std::cout << "EventLoopThread stopped.";
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment