Fixes to RabbitMQ filter and consumer.
This commit is contained in:
@ -100,10 +100,6 @@ add_subdirectory(server)
|
|||||||
if(NOT WITHOUT_MAXADMIN)
|
if(NOT WITHOUT_MAXADMIN)
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
endif()
|
endif()
|
||||||
if(BUILD_RABBITMQ)
|
|
||||||
find_package(RabbitMQ)
|
|
||||||
add_subdirectory(rabbitmq_consumer)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
file(GLOB DOCS Documentation/*.pdf)
|
file(GLOB DOCS Documentation/*.pdf)
|
||||||
message(STATUS "Installing MaxScale to: ${CMAKE_INSTALL_PREFIX}/")
|
message(STATUS "Installing MaxScale to: ${CMAKE_INSTALL_PREFIX}/")
|
||||||
|
@ -3,10 +3,11 @@ include(../macros.cmake)
|
|||||||
enable_testing()
|
enable_testing()
|
||||||
set_variables()
|
set_variables()
|
||||||
set(CMAKE_INSTALL_PREFIX "/usr/local/skysql/rabbitmq-consumer" CACHE PATH "Prefix prepended to install directories.")
|
set(CMAKE_INSTALL_PREFIX "/usr/local/skysql/rabbitmq-consumer" CACHE PATH "Prefix prepended to install directories.")
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../cmake")
|
||||||
|
|
||||||
project("RabbitMQ Consumer")
|
project("RabbitMQ Consumer")
|
||||||
|
|
||||||
|
configure_file(${CMAKE_SOURCE_DIR}/consumer.c ${CMAKE_BINARY_DIR}/consumer.c)
|
||||||
|
|
||||||
find_package(RabbitMQ)
|
find_package(RabbitMQ)
|
||||||
find_package(MySQLClient)
|
find_package(MySQLClient)
|
||||||
@ -14,9 +15,10 @@ find_package(MySQLClient)
|
|||||||
set(CMAKE_C_FLAGS "-Wall -fPIC")
|
set(CMAKE_C_FLAGS "-Wall -fPIC")
|
||||||
set(CMAKE_CXX_FLAGS "-Wall -fPIC")
|
set(CMAKE_CXX_FLAGS "-Wall -fPIC")
|
||||||
include_directories(${MYSQLCLIENT_HEADERS})
|
include_directories(${MYSQLCLIENT_HEADERS})
|
||||||
|
include_directories(${RABBITMQ_HEADERS})
|
||||||
include_directories(inih)
|
include_directories(inih)
|
||||||
add_subdirectory(inih)
|
add_subdirectory(inih)
|
||||||
add_executable (consumer consumer.c)
|
add_executable (consumer ${CMAKE_BINARY_DIR}/consumer.c)
|
||||||
|
|
||||||
if(MYSQLCLIENT_FOUND)
|
if(MYSQLCLIENT_FOUND)
|
||||||
target_link_libraries(consumer ${MYSQLCLIENT_LIBRARIES} rabbitmq inih ssl crypt crypto dl z m pthread)
|
target_link_libraries(consumer ${MYSQLCLIENT_LIBRARIES} rabbitmq inih ssl crypt crypto dl z m pthread)
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#Use the '-I' prefix for include and '-L' for library directories
|
|
||||||
#You can use multiple library and include directories
|
|
||||||
|
|
||||||
#Path to the rabbitmq-c and mysqlclient libraries
|
|
||||||
LIBRARY_DIRS :=-L/usr/lib64
|
|
||||||
|
|
||||||
#path to headers
|
|
||||||
INCLUDE_DIRS :=-I/usr/include -I/usr/include/mysql
|
|
@ -337,6 +337,7 @@ int main(int argc, char** argv)
|
|||||||
MYSQL db_inst;
|
MYSQL db_inst;
|
||||||
char ch, *cnfname = NULL, *cnfpath = NULL;
|
char ch, *cnfname = NULL, *cnfpath = NULL;
|
||||||
static const char* fname = "consumer.cnf";
|
static const char* fname = "consumer.cnf";
|
||||||
|
const char* default_path = "@CMAKE_INSTALL_PREFIX@/etc";
|
||||||
|
|
||||||
if((c_inst = calloc(1,sizeof(CONSUMER))) == NULL){
|
if((c_inst = calloc(1,sizeof(CONSUMER))) == NULL){
|
||||||
fprintf(stderr, "Fatal Error: Cannot allocate enough memory.\n");
|
fprintf(stderr, "Fatal Error: Cannot allocate enough memory.\n");
|
||||||
@ -359,6 +360,12 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(cnfpath == NULL)
|
||||||
|
{
|
||||||
|
cnfpath = strdup(default_path);
|
||||||
|
cnfnlen = strlen(default_path);
|
||||||
|
}
|
||||||
|
|
||||||
cnfname = calloc(cnfnlen + strlen(fname) + 1,sizeof(char));
|
cnfname = calloc(cnfnlen + strlen(fname) + 1,sizeof(char));
|
||||||
|
|
||||||
if(cnfpath){
|
if(cnfpath){
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
if(BUILD_RABBITMQ)
|
if(BUILD_RABBITMQ)
|
||||||
|
find_package(RabbitMQ)
|
||||||
|
include_directories(${RABBITMQ_HEADERS})
|
||||||
add_library(mqfilter SHARED mqfilter.c)
|
add_library(mqfilter SHARED mqfilter.c)
|
||||||
target_link_libraries(mqfilter query_classifier log_manager utils rabbitmq)
|
target_link_libraries(mqfilter query_classifier log_manager utils ${RABBITMQ_LIBRARIES})
|
||||||
install(TARGETS mqfilter DESTINATION modules)
|
install(TARGETS mqfilter DESTINATION modules)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*
|
*
|
||||||
* logging_trigger Set the logging level
|
* logging_trigger Set the logging level
|
||||||
* logging_strict Sets whether to trigger when any of the parameters match or only if all parameters match
|
* logging_strict Sets whether to trigger when any of the parameters match or only if all parameters match
|
||||||
* logging_log_all Log only SELECT, UPDATE, DELETE and INSERT or all posddible queries
|
* logging_log_all Log only SELECT, UPDATE, DELETE and INSERT or all possible queries
|
||||||
* hostname The server hostname where the messages are sent
|
* hostname The server hostname where the messages are sent
|
||||||
* port Port to send the messages to
|
* port Port to send the messages to
|
||||||
* username Server login username
|
* username Server login username
|
||||||
|
Reference in New Issue
Block a user