use of com.creditease.uav.collect.server.messaging.DefaultGatherDataHandler in project uavstack by uavorg.
the class GatherDataManager method start.
@Override
public void start() {
StandardMessagingBuilder builder = new StandardMessagingBuilder("GatherDataManagerMessageBuilder", feature);
try {
builder.init();
} catch (IOException e) {
log.err(this, "Read msgtype2topic.properties FAILs, GatherDataManager can not START", e);
return;
}
String[] topics = getConfigManager().getFeatureConfiguration(feature, "topics").split(",");
List<MessageHandler> handlers = new ArrayList<>();
for (String topic : topics) {
handlers.add(new DefaultGatherDataHandler(topic));
}
MessagingContext.putConsumerHandlers(handlers);
// init consumers
consumers = new ArrayList<>();
for (String topic : topics) {
MessageConsumer consumer = builder.buildConsumer(topic);
if (consumer == null) {
continue;
}
consumers.add(consumer);
}
// start all consumers
for (MessageConsumer consumer : consumers) {
consumer.start();
log.info(this, "GatherData Consumer [" + consumer.getName() + "] start");
}
log.info(this, "GatherDataManager start");
}
Aggregations