Commit 620c6d48 by Amir Aharon

comment out RabbitMQ

parent 9ab5f09a
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/include/c++/4.9",
"/usr/include/x86_64-linux-gnu/c++/4.9",
"/usr/include/c++/4.9/backward",
"/usr/lib/gcc/x86_64-linux-gnu/4.9/include",
"/usr/local/include",
"/usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"${workspaceRoot}/src"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include/c++/4.9",
"/usr/include/x86_64-linux-gnu/c++/4.9",
"/usr/include/c++/4.9/backward",
"/usr/lib/gcc/x86_64-linux-gnu/4.9/include",
"/usr/local/include",
"/usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 3
}
\ No newline at end of file
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "run build env",
"type": "shell",
"command": "docker-compose -f develop-compose.yml run --name devenv dev-microservice bash",
"problemMatcher": []
},
{
"label": "stop build env",
"type": "shell",
"command": "docker-compose -f develop-compose.yml down",
"problemMatcher": []
},
{
"label": "cmake generate",
"type": "shell",
"command": "docker exec -it devenv cmake .",
"problemMatcher": []
},
{
"label": "build",
"type": "shell",
"command": "docker exec -it devenv make",
"problemMatcher": [
"$gcc"
]
},
{
"label": "clean",
"type": "shell",
"command": "docker exec -it dev-microservice make clean"
}
]
}
\ No newline at end of file
......@@ -19,7 +19,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
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_random -lboost_chrono -lboost_system -lboost_thread -lssl
-lcrypto -lRabbitmq -lrabbitmq -llog4cpp -lglog -lzmqpp -lzmq )
-lcrypto -llog4cpp -lglog -lzmqpp -lzmq )
# 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_random -lboost_chrono -lboost_system -lboost_thread -lssl
# -lcrypto -lRabbitmq -lrabbitmq -llog4cpp -lglog -lzmqpp -lzmq )
link_directories( ../3party/lib )
link_directories( ../internals/lib )
......@@ -34,16 +39,32 @@ include_directories(SYSTEM ../3party/cpprest/Release/include)
include_directories(SYSTEM ../3party/rabbitmq)
include_directories(SYSTEM ../3party/flatbuffers/include)
include_directories(SYSTEM ../3party/poco-1.7.8/Foundation/include)
include_directories(SYSTEM ../3party/evpp/build-release/include)
include_directories(SYSTEM ../internals/include/Rabbitmq)
include_directories(SYSTEM /usr/include/Poco)
include_directories(SYSTEM /usr/include/hiredis)
# recursive search files cpp files
file(GLOB_RECURSE SOURCES "src/*.cpp" src/Microservice_BaseRestResponse.h src/common/Microservice_RestResponse.h src/common/Microservice_MsgQContext.h src/handlers/Microservice_Reactor.cpp src/handlers/Microservice_Reactor.h src/common/Microservice_PubSubContext.h src/handlers/Microservice_MsgQHandler.h src/handlers/Microservice_PubSubHandler.h src/impl/servers/Microservice_IMsgQueueServerZmqImpl.cpp src/impl/servers/Microservice_IMsgQueueServerZmqImpl.h src/impl/Microservice_IMsgArchiverCerealImpls.h src/utils/ServerFactory.cpp src/utils/ServerFactory.h src/utils/ClientFactory.cpp src/utils/ClientFactory.h src/impl/clients/MSZMQClientImpl.cpp src/impl/clients/MSZMQClientImpl.h src/impl/clients/MSIPubSubClientImpl.cpp src/impl/clients/MSIPubSubClientImpl.h)
set (3PARTY_SOURCES ../3party/civetweb/src/civetweb.c ../3party/civetweb/src/CivetServer.cpp ../3party/civetweb/src/md5.inl ../3party/civetweb/src/handle_form.inl)
# remove RMQ for now
get_filename_component(RMQHandler_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/handlers/Microservice_RMQHandler.cpp ABSOLUTE)
get_filename_component(RMQRequest_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/Microservice_IRequestRMQImpl.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(RMQClient_file_path ${CMAKE_CURRENT_SOURCE_DIR}/src/impl/clients/MSICommandClientRMQImpl.cpp ABSOLUTE)
message("${RMQHandler_file_path}")
list(REMOVE_ITEM SOURCES "${RMQHandler_file_path}"
"${RMQRequest_file_path}"
"${RMQResponse_file_path}"
"${RMQServer_file_path}"
"${RMQClient_file_path}")
#Generate the shared library from the sources
add_library(Microservice SHARED ${SOURCES} ${3PARTY_SOURCES} src/impl/servers/Microservice_IRestServerZmqImpl.cpp src/impl/servers/Microservice_IRestServerZmqImpl.h src/common/Microservice_Iface.cpp src/impl/clients/MSICommandClientZmqImpl.cpp src/impl/clients/MSICommandClientZmqImpl.h src/impl/Microservice_ICacheClientPocoImpl.h src/handlers/Microservice_TestHandler.cpp src/handlers/Microservice_TestHandler.h)
add_library(Microservice SHARED ${SOURCES} ${3PARTY_SOURCES} src/impl/servers/Microservice_IRestServerEvppImpl.cpp src/impl/servers/Microservice_IRestServerEvppImpl.h src/impl/servers/Microservice_IRestServerZmqImpl.cpp src/impl/servers/Microservice_IRestServerZmqImpl.h src/common/Microservice_Iface.cpp src/impl/clients/MSICommandClientZmqImpl.cpp src/impl/clients/MSICommandClientZmqImpl.h src/impl/Microservice_ICacheClientPocoImpl.h src/handlers/Microservice_TestHandler.cpp src/handlers/Microservice_TestHandler.h)
target_link_libraries(Microservice ${PROJECT_LINK_LIBS} )
set_target_properties(Microservice PROPERTIES VERSION ${Microservice_VERSION_STRING}
SOVERSION ${Microservice_VERSION_MAJOR})
......
#FROM ubuntu:14.04
FROM ubuntu-debootstrap:14.04
#FROM ubuntu-debootstrap:14.04
FROM municipalitybank.com:5050/mcx/devops/dev-cpp
#COPY ./doc/install-dependencies.sh /usr/
#RUN chmod +x /usr/install-dependencies.sh
USER root
COPY ./doc/install-dependencies.sh /usr/
RUN chmod +x /usr/install-dependencies.sh
#RUN apt-get update
#RUN /usr/install-dependencies.sh
RUN apt-get update
RUN /usr/install-dependencies.sh
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
......@@ -19,9 +21,10 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#RUN echo kernel.shmall=10485760 >> /etc/sysctl.conf
# app
COPY ./tmp/* /usr/lib/x86_64-linux-gnu/
COPY ./bin/test_MicroserviceClient /usr/
# COPY ./tmp/* /usr/lib/x86_64-linux-gnu/
# COPY ./bin/test_MicroserviceClient /usr/
WORKDIR /usr
# WORKDIR /usr
USER develop
ENTRYPOINT ["./test_MicroserviceClient"]
# ENTRYPOINT ["./test_MicroserviceClient"]
version: '2'
services:
##### dev-microservice
dev-microservice:
image: municipalitybank.com:5050/ipgallery.common.cpp/microservice/develop
# ports:
# - "27027:27017"
volumes:
- "./:/home/develop/project"
- "./../3party:/home/develop/3party"
# command: bash
\ No newline at end of file
......@@ -5,7 +5,7 @@
#include "ServerFactory.h"
#include <impl/servers/Microservice_IRestServerCivetWebImpl.h>
#include <impl/servers/Microservice_IMsgQueueServerZmqImpl.h>
#include <impl/servers/Microservice_IRestServerRMQImpl.h>
//#include <impl/servers/Microservice_IRestServerRMQImpl.h>
#include <impl/servers/Microservice_IRestServerZmqImpl.h>
cMicroservice_IRestServerCivetWebImpl *
......@@ -18,10 +18,10 @@ ServerFactory::createIMsgQueueServerZmqImpl(std::string host, int port, Microser
return new Microservice_IMsgQueueServerZmqImpl(Microservice_ZMQServerParams(host,port,protocol));
}
cMicroservice_IRestServerRMQImpl *
ServerFactory::createcIRestServerRMQImpl(std::string host, int port, std::string listenQueueId, std::string exchange) {
return new cMicroservice_IRestServerRMQImpl(new cMicroservice_RMQServerParams(host,port,listenQueueId,exchange));
}
// cMicroservice_IRestServerRMQImpl *
// ServerFactory::createcIRestServerRMQImpl(std::string host, int port, std::string listenQueueId, std::string exchange) {
// return new cMicroservice_IRestServerRMQImpl(new cMicroservice_RMQServerParams(host,port,listenQueueId,exchange));
// }
Microservice_IRestServerZmqImpl *
ServerFactory::createIRestServerZmqImpl(std::string host, int port, Microservice_ZMQServerParams::eProtocol protocol) {
......
......@@ -10,7 +10,7 @@
class cMicroservice_IRestServerCivetWebImpl;
class Microservice_IMsgQueueServerZmqImpl;
class cMicroservice_IRestServerRMQImpl;
//class cMicroservice_IRestServerRMQImpl;
class Microservice_IRestServerZmqImpl;
/**
......@@ -25,10 +25,10 @@ public:
static Microservice_IMsgQueueServerZmqImpl* createIMsgQueueServerZmqImpl(std::string host,
int port,
Microservice_ZMQServerParams::eProtocol aProtocol);
static cMicroservice_IRestServerRMQImpl* createcIRestServerRMQImpl(std::string host,
int port,
std::string listenQueueId,
std::string exchange);
// static cMicroservice_IRestServerRMQImpl* createcIRestServerRMQImpl(std::string host,
// int port,
// std::string listenQueueId,
// std::string exchange);
static Microservice_IRestServerZmqImpl* createIRestServerZmqImpl(std::string host,
int port,
Microservice_ZMQServerParams::eProtocol aProtocol);
......
......@@ -7,9 +7,9 @@
#include <stdlib.h>
#include <Microservice_App.h>
#include <impl/servers/Microservice_IRestServerCivetWebImpl.h>
#include <impl/servers/Microservice_IRestServerRMQImpl.h>
// #include <impl/servers/Microservice_IRestServerRMQImpl.h>
#include <impl/clients/MSICommandClientHttpImpl.h>
#include <impl/clients/MSICommandClientRMQImpl.h>
// #include <impl/clients/MSICommandClientRMQImpl.h>
#include "impl/Microservices_ILoggerLog4cppImpl.h"
......@@ -39,33 +39,33 @@ void testRapidJson();
void SendZmqRestRequests(const Microservice_App &msApp, cMicroservice_Client *p_zmqClient, int iterations);
void runTest()
{
cMicroservice_BaseClientParams RMQClientParams("MyFirstQ@test1", false, 0, false,"localhost", 5672);
cMicroservices_ILoggerLog4cppImpl *pc_Logger = new cMicroservices_ILoggerLog4cppImpl("ServiceClientTest"); // default logger
cMicroservice_Client* pc_Client = new cMicroservice_Client(new MSICommandClientRMQImpl(&RMQClientParams),&RMQClientParams);
MSRetStat ret = pc_Client->Init(pc_Logger);
if (ret.IsSuccess() == false)
{
pc_Logger->error("Failed to initialize cMicroservice_Client");
return;
}
cMicroservice_BaseRestResponse rest_response;
MSCommandParams cmd_params;
cmd_params
.WithEntity("http://172.16.1.151:50025/")
.WithParamsString("publicSafety")
.WithRequestParams("");
MSRetStat retstat = pc_Client->Read(&cmd_params, &rest_response);
std::string msg = "response: ";
if (rest_response.IsSuccess())
msg += "ok";
else
msg += "failed";
}
// void runTest()
// {
// cMicroservice_BaseClientParams RMQClientParams("MyFirstQ@test1", false, 0, false,"localhost", 5672);
// cMicroservices_ILoggerLog4cppImpl *pc_Logger = new cMicroservices_ILoggerLog4cppImpl("ServiceClientTest"); // default logger
// cMicroservice_Client* pc_Client = new cMicroservice_Client(new MSICommandClientRMQImpl(&RMQClientParams),&RMQClientParams);
// MSRetStat ret = pc_Client->Init(pc_Logger);
// if (ret.IsSuccess() == false)
// {
// pc_Logger->error("Failed to initialize cMicroservice_Client");
// return;
// }
// cMicroservice_BaseRestResponse rest_response;
// MSCommandParams cmd_params;
// cmd_params
// .WithEntity("http://172.16.1.151:50025/")
// .WithParamsString("publicSafety")
// .WithRequestParams("");
// MSRetStat retstat = pc_Client->Read(&cmd_params, &rest_response);
// std::string msg = "response: ";
// if (rest_response.IsSuccess())
// msg += "ok";
// else
// msg += "failed";
// }
void runPubSubTest()
{
......
......@@ -13,7 +13,7 @@
#include <document.h> //rapidjson
#include <impl/servers/Microservice_IRestServerCivetWebImpl.h>
#include <impl/servers/Microservice_IMsgQueueServerZmqImpl.h>
#include <impl/servers/Microservice_IRestServerRMQImpl.h>
// #include <impl/servers/Microservice_IRestServerRMQImpl.h>
#include <impl/Microservice_ICacheClientRedisImpl.h>
#include <impl/clients/MSICommandClientHttpImpl.h>
#include <Microservice_BaseRestResponse.h>
......
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