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:
Alexey Rybalchenko
2016-03-31 14:41:05 +02:00
committed by Mohammad Al-Turany
parent 8317d440db
commit 13453354c8
40 changed files with 211 additions and 605 deletions

View File

@@ -7,6 +7,7 @@
################################################################################
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/6-multiple-channels/ex6-multiple-channels.json ${CMAKE_BINARY_DIR}/bin/config/ex6-multiple-channels.json)
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/6-multiple-channels/startMQEx6.sh.in ${CMAKE_BINARY_DIR}/bin/startMQEx6.sh)
Set(INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/fairmq

View File

@@ -33,18 +33,7 @@ int main(int argc, char** argv)
return 0;
}
std::string filename = config.GetValue<std::string>("config-json-file");
std::string id = config.GetValue<std::string>("id");
config.UserParser<FairMQParser::JSON>(filename, id);
broadcaster.fChannels = config.GetFairMQMap();
LOG(INFO) << "PID: " << getpid();
broadcaster.SetTransport(config.GetValue<std::string>("transport"));
broadcaster.SetProperty(FairMQExample6Broadcaster::Id, id);
broadcaster.SetConfig(config);
broadcaster.ChangeState("INIT_DEVICE");
broadcaster.WaitForEndOfState("INIT_DEVICE");

View File

@@ -45,18 +45,7 @@ int main(int argc, char** argv)
return 0;
}
std::string filename = config.GetValue<std::string>("config-json-file");
std::string id = config.GetValue<std::string>("id");
config.UserParser<FairMQParser::JSON>(filename, id);
sampler.fChannels = config.GetFairMQMap();
LOG(INFO) << "PID: " << getpid();
sampler.SetTransport(config.GetValue<std::string>("transport"));
sampler.SetProperty(FairMQExample6Sampler::Id, id);
sampler.SetConfig(config);
sampler.SetProperty(FairMQExample6Sampler::Text, text);
sampler.ChangeState("INIT_DEVICE");

View File

@@ -37,18 +37,7 @@ int main(int argc, char** argv)
return 0;
}
std::string filename = config.GetValue<std::string>("config-json-file");
std::string id = config.GetValue<std::string>("id");
config.UserParser<FairMQParser::JSON>(filename, id);
sink.fChannels = config.GetFairMQMap();
LOG(INFO) << "PID: " << getpid();
sink.SetTransport(config.GetValue<std::string>("transport"));
sink.SetProperty(FairMQExample6Sink::Id, id);
sink.SetConfig(config);
sink.ChangeState("INIT_DEVICE");
sink.WaitForEndOfState("INIT_DEVICE");

View File

@@ -0,0 +1,17 @@
#!/bin/bash
ex6config="@CMAKE_BINARY_DIR@/bin/config/ex6-multiple-channels.json"
SAMPLER="ex6-sampler"
SAMPLER+=" --id sampler1"
SAMPLER+=" --mq-config $ex6config"
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SAMPLER &
SINK="ex6-sink"
SINK+=" --id sink1"
SINK+=" --mq-config $ex6config"
xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SINK &
BROADCASTER="ex6-broadcaster"
BROADCASTER+=" --id broadcaster1"
BROADCASTER+=" --mq-config $ex6config"
xterm -geometry 80x23+250+330 -hold -e @CMAKE_BINARY_DIR@/bin/$BROADCASTER &