mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Configuration and DDS example/tools updates
- Update DDS example command UI and extract it from example. - Unify address handling via DDS properties for dynamic deployment. - Update DDS docs with the new approach. - Allow `--config-key` to be used to access common config in JSON. - Allow common channel properties to be specified for all sockets. - Update MQ examples and Tuto3 with new config options. - Add start scripts to MQ examples for easier use.
This commit is contained in:
committed by
Mohammad Al-Turany
parent
8317d440db
commit
13453354c8
@@ -7,6 +7,7 @@
|
||||
################################################################################
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/5-req-rep/ex5-req-rep.json ${CMAKE_BINARY_DIR}/bin/config/ex5-req-rep.json)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/5-req-rep/startMQEx5.sh.in ${CMAKE_BINARY_DIR}/bin/startMQEx5.sh)
|
||||
|
||||
Set(INCLUDE_DIRECTORIES
|
||||
${CMAKE_SOURCE_DIR}/fairmq
|
||||
|
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"fairMQOptions":
|
||||
{
|
||||
"device":
|
||||
{
|
||||
"devices":
|
||||
[{
|
||||
"id": "client",
|
||||
"channel":
|
||||
{
|
||||
@@ -18,8 +18,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"device":
|
||||
{
|
||||
"id": "server",
|
||||
"channel":
|
||||
@@ -35,7 +33,7 @@
|
||||
"rateLogging": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -46,18 +46,7 @@ int main(int argc, char** argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
string filename = config.GetValue<string>("config-json-file");
|
||||
string id = config.GetValue<string>("id");
|
||||
|
||||
config.UserParser<FairMQParser::JSON>(filename, id);
|
||||
|
||||
client.fChannels = config.GetFairMQMap();
|
||||
|
||||
LOG(INFO) << "PID: " << getpid();
|
||||
|
||||
client.SetTransport(config.GetValue<std::string>("transport"));
|
||||
|
||||
client.SetProperty(FairMQExample5Client::Id, id);
|
||||
client.SetConfig(config);
|
||||
client.SetProperty(FairMQExample5Client::Text, text);
|
||||
|
||||
client.ChangeState("INIT_DEVICE");
|
||||
|
@@ -14,15 +14,12 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "boost/program_options.hpp"
|
||||
|
||||
#include "FairMQLogger.h"
|
||||
#include "FairMQParser.h"
|
||||
#include "FairMQProgOptions.h"
|
||||
#include "FairMQExample5Server.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace boost::program_options;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
@@ -38,18 +35,7 @@ int main(int argc, char** argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
string filename = config.GetValue<string>("config-json-file");
|
||||
string id = config.GetValue<string>("id");
|
||||
|
||||
config.UserParser<FairMQParser::JSON>(filename, id);
|
||||
|
||||
server.fChannels = config.GetFairMQMap();
|
||||
|
||||
LOG(INFO) << "PID: " << getpid();
|
||||
|
||||
server.SetTransport(config.GetValue<std::string>("transport"));
|
||||
|
||||
server.SetProperty(FairMQExample5Server::Id, id);
|
||||
server.SetConfig(config);
|
||||
|
||||
server.ChangeState("INIT_DEVICE");
|
||||
server.WaitForEndOfState("INIT_DEVICE");
|
||||
|
12
examples/MQ/5-req-rep/startMQEx5.sh.in
Executable file
12
examples/MQ/5-req-rep/startMQEx5.sh.in
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
ex5config="@CMAKE_BINARY_DIR@/bin/config/ex5-req-rep.json"
|
||||
|
||||
CLIENT="ex5-client"
|
||||
CLIENT+=" --id client"
|
||||
CLIENT+=" --mq-config $ex5config"
|
||||
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/$CLIENT &
|
||||
|
||||
SERVER="ex5-server"
|
||||
SERVER+=" --id server"
|
||||
SERVER+=" --mq-config $ex5config"
|
||||
xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SERVER &
|
Reference in New Issue
Block a user