<modelVersion>4.0.0</modelVersion>
<groupId>org.iotivity.cloud</groupId>
- <artifactId>parent</artifactId>
+ <artifactId>parentCloud</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Iotivity Parent</name>
*/
package com.samsung.servermq;
+import com.samsung.servermq.iotivity.extractor.impl.DeviceRegistrationPostDataExtractor;
+import org.apache.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
* @par LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
* @par Copyright : (c) Samsung Electronics Co, Ltd 2017. All rights reserved.
*/
-@PropertySource("classpath:iotivity.properties")
-
+@PropertySources({
+ @PropertySource("classpath:application.properties"),
+ @PropertySource("classpath:iotivity.properties") })
@SpringBootApplication
@ImportResource("classpath:root-context.xml")
@EnableAutoConfiguration(exclude = {
private static String zookeeperHost;
private static String kafkaHost;
+ private static String dmsHost;
+ private static final Logger LOG = Logger.getLogger(ServerMQ.class);
private static void getHosts() {
@SuppressWarnings("resource")
ctx.refresh();
zookeeperHost = ctx.getEnvironment().getRequiredProperty("iotivity.zookeeper_host");
kafkaHost = ctx.getEnvironment().getRequiredProperty("iotivity.kafka_host");
+ dmsHost = ctx.getEnvironment().getRequiredProperty("dsm.host").replace("http://", "");
}
/**
getHosts();
while (!checkSocket(zookeeperHost)) {
Thread.sleep(1000);
- System.out.println("can not connect to zookeeper...");
+ LOG.info("can not connect to zookeeper...");
}
while (!checkSocket(kafkaHost)) {
Thread.sleep(1000);
- System.out.println("can not connect to kafka...");
+ LOG.info("can not connect to kafka...");
+ }
+
+ while (!checkSocket(dmsHost)) {
+ Thread.sleep(1000);
+ LOG.info("can not connect to dms server...");
}
context = SpringApplication.run(ServerMQ.class, args);