Developing plugin using Rabbitmq message broker
AnsweredHi,
I am developing a plugin for my existing Detection software. I am trying to use Rabbitmq(Message broker) to send data from my detection software to the nx witness plugin.
The rabbitmq requires a client for c++ to be integrated with the plugin that I am developing. I have tested the rabbitmq client for c++ in the local machine and its working perfectly but having problem integrating with the plugin.
I am new to c++ and cmake technologies and learning it side by side. I am looking for guidance to integrate rabbitmq-c client with the plugin.
Any kind of help is appreciated.
Thank you in advance.
-
Hi,
we are not familiar with Rabbitmq, so we won't be able to provide clear guidance. What kind of issues are you having? It looks like having Rabbitmq thread inside the plugin for each device agent might actually work, but it is difficult to comment on that without full context.
'm assuming you have issue connecting rabbitmq-c module to your project, but we need some samples and examples on which we can follow up with advises.
0 -
Hi Anton,
Thank you for your response. Right now, I am trying to integrate with the sample analytics plugin for testing.
I have copied rabbitmq-c folder inside the sample analytics plugin folder and then added the following lines in cmakelist.txt of the sample analytics plugin:
#Integrate Rabbitmq-c
add_subdirectory(rabbitmq-c)
target_include_directories(fs_vagrancy_plugin PUBLIC rabbitmq-c/librabbitmq)
target_link_directories(fs_vagrancy_plugin PRIVATE rabbitmq-c/librabbitmq/Debug)
target_link_libraries(fs_vagrancy_plugin PRIVATE rabbitmq-c/librabbitmq/Debug/rabbitmq.4)Then I included a header file from rabbitmq-c inside the device agent and used one functionality After running .\build_samples.bat file, the build was successful.
After this, I copied sample_analytics_plugin.dll to nx witness server's media plugin directory but got following error:
{"description":"",
"errorCode":"cannotLoadLibrary",
"homeDir":"",
"instanceIndex":-1,
"isActive":true,
"libName":"sample_analytics_plugin",
"libraryFilename":"C:/Program Files/Network Optix/Nx Meta/MediaServer/plugins/sample_analytics_plugin.dll",
"mainInterface":"undefined",
"name":"","nxSdkVersion":"",
"optionality":"nonOptional",
"resourceBindingInfo":[],
"status":"notLoadedBecauseOfError",
"statusMessage":"Failed loading Server Plugin [C:/Program Files/Network Optix/Nx Meta/MediaServer/plugins/sample_analytics_plugin.dll] (): [cannotLoadLibrary]: Cannot load library C:\\Program Files\\Network Optix\\Nx Meta\\MediaServer\\plugins\\sample_analytics_plugin.dll: The specified module could not be found.","vendor":"","version":""},I have tried the solution mentioned in Organizing third-party library files but the same issue occurs. maybe it's because of my no experience with CMake before I am unable to link the library statistically.
Any kind of help is appreciated, thank you in advance.
0 -
Hello,
A guess, while loading the plugin, the Server can't find the debug version of the rabbitmq library binary.
Please read this article, the "Organizing third-party library files" section
https://support.networkoptix.com/hc/en-us/articles/360057029774-Step-4-Adding-Object-Detection
0
Please sign in to leave a comment.
Comments
3 comments