Commit febb2c69 authored by 赵啸非's avatar 赵啸非

修改配置文件

parent b65a8129
......@@ -5,7 +5,6 @@
<parent>
<artifactId>mqtt</artifactId>
<groupId>com.mortals</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -28,9 +28,16 @@ public class MQServer {
public static void main(String[] args) {
try {
//String filePath = MQServer.class.getClassLoader().getResource("conf//mq.properties").getPath();
//System.out.println("filePath:"+filePath);
//启动mqtt service
startMqttService(args);
//启动coap service
//todo 启动coap service
//todo 启动http服务
} catch (Exception e) {
log.error("mqtt start failure,cause = " ,e);
System.exit(-1);
......
package com.mortals.mqtt.broker.common.config;
import com.codahale.metrics.MetricRegistry;
import com.mortals.MQServer;
import lombok.Data;
import java.io.File;
......@@ -12,8 +13,7 @@ import java.io.File;
public class BrokerConfig {
// 配置conf文件的所在位置,logback,properties文件等所在位置
private String mqttHome = System.getenv("MQTT_HOME") != null ? System.getenv("MQTT_HOME") : System.getProperty("user.dir")
+ File.separator + "src" + File.separator + "main" + File.separator + "resources";
private String mqttHome = MQServer.class.getClassLoader().getResource("").getPath();
private String logLevel = "INFO";
protected static final String PRE = "mqtt.broker.";
......@@ -67,8 +67,8 @@ public class BrokerConfig {
*/
//是否启用kafka消息转发
private boolean kafkaBrokerEnabled= true;
//kafka地址 127.0.0.1:9092,127.0.0.1:9093
private String kafkaServerAddr="127.0.0.1:9092";
//kafka地址 127.0.0.1:9092,127.0.0.1:9093,192.168.0.251:9092
private String kafkaServerAddr="192.168.0.251:9092";
//acks回令 如果必须等待回令,那么设置acks为all,否则,设置为-1,等待回令会有性能损耗
private String kafkaAcks="-1";
//重试次数
......
......@@ -11,7 +11,7 @@
<modules>
<module>mqtt-broker</module>
</modules>
<version>0.0.1</version>
<version>0.0.1-SNAPSHOT</version>
<name>mqtt</name>
<description>java mqtt broker</description>
......@@ -30,7 +30,6 @@
<druid.version>1.2.4</druid.version>
<jdbc.version>8.0.16</jdbc.version>
<log4j2.version>2.13.3</log4j2.version>
<junit.version>5.7.0</junit.version>
<paho.version>1.2.5</paho.version>
<fastjson.version>1.2.62</fastjson.version>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment