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/4-copypush/ex4-copypush.json ${CMAKE_BINARY_DIR}/bin/config/ex4-copypush.json)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/4-copypush/startMQEx4.sh.in ${CMAKE_BINARY_DIR}/bin/startMQEx4.sh)
|
||||
|
||||
Set(INCLUDE_DIRECTORIES
|
||||
${CMAKE_SOURCE_DIR}/fairmq
|
||||
|
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"fairMQOptions":
|
||||
{
|
||||
"device":
|
||||
{
|
||||
"devices":
|
||||
[{
|
||||
"id": "sampler1",
|
||||
"channel":
|
||||
{
|
||||
"name": "data",
|
||||
"socket":
|
||||
{
|
||||
"sockets":
|
||||
[{
|
||||
"type": "push",
|
||||
"method": "bind",
|
||||
"address": "tcp://*:5555",
|
||||
@@ -16,7 +16,6 @@
|
||||
"rcvBufSize": "1000",
|
||||
"rateLogging": "0"
|
||||
},
|
||||
"socket":
|
||||
{
|
||||
"type": "push",
|
||||
"method": "bind",
|
||||
@@ -24,11 +23,9 @@
|
||||
"sndBufSize": "1000",
|
||||
"rcvBufSize": "1000",
|
||||
"rateLogging": "0"
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
|
||||
"device":
|
||||
{
|
||||
"id": "sink1",
|
||||
"channel":
|
||||
@@ -45,8 +42,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"device":
|
||||
{
|
||||
"id": "sink2",
|
||||
"channel":
|
||||
@@ -62,7 +57,7 @@
|
||||
"rateLogging": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
sampler.fChannels = config.GetFairMQMap();
|
||||
|
||||
LOG(INFO) << "PID: " << getpid();
|
||||
|
||||
sampler.SetTransport(config.GetValue<std::string>("transport"));
|
||||
|
||||
sampler.SetProperty(FairMQExample4Sampler::Id, id);
|
||||
sampler.SetConfig(config);
|
||||
|
||||
sampler.ChangeState("INIT_DEVICE");
|
||||
sampler.WaitForEndOfState("INIT_DEVICE");
|
||||
|
@@ -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);
|
||||
|
||||
sink.fChannels = config.GetFairMQMap();
|
||||
|
||||
LOG(INFO) << "PID: " << getpid();
|
||||
|
||||
sink.SetTransport(config.GetValue<std::string>("transport"));
|
||||
|
||||
sink.SetProperty(FairMQExample4Sink::Id, id);
|
||||
sink.SetConfig(config);
|
||||
|
||||
sink.ChangeState("INIT_DEVICE");
|
||||
sink.WaitForEndOfState("INIT_DEVICE");
|
||||
|
17
examples/MQ/4-copypush/startMQEx4.sh.in
Executable file
17
examples/MQ/4-copypush/startMQEx4.sh.in
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
ex4config="@CMAKE_BINARY_DIR@/bin/config/ex4-copypush.json"
|
||||
|
||||
SAMPLER="ex4-sampler"
|
||||
SAMPLER+=" --id sampler1"
|
||||
SAMPLER+=" --mq-config $ex4config"
|
||||
xterm -geometry 80x23+0+165 -hold -e @CMAKE_BINARY_DIR@/bin/$SAMPLER &
|
||||
|
||||
SINK1="ex4-sink"
|
||||
SINK1+=" --id sink1"
|
||||
SINK1+=" --mq-config $ex4config"
|
||||
xterm -geometry 80x23+500+0 -hold -e @CMAKE_BINARY_DIR@/bin/$SINK1 &
|
||||
|
||||
SINK2="ex4-sink"
|
||||
SINK2+=" --id sink2"
|
||||
SINK2+=" --mq-config $ex4config"
|
||||
xterm -geometry 80x23+500+330 -hold -e @CMAKE_BINARY_DIR@/bin/$SINK2 &
|
Reference in New Issue
Block a user