读取config中的配置文件xxl-job-executor.properties

pull/62/head
xieke 12 months ago
parent 6e78d5a596
commit 150a38a854

@ -6,8 +6,7 @@ import com.xxl.job.core.executor.impl.XxlJobSimpleExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
import java.util.Arrays;
import java.util.Properties;
@ -70,8 +69,13 @@ public class QpCollectorJobConfig {
InputStreamReader in = null;
try {
ClassLoader loder = Thread.currentThread().getContextClassLoader();
in = new InputStreamReader(loder.getResourceAsStream(propertyFileName), "UTF-8");;
String configFileName = "config/"+propertyFileName;
try {
in = new FileReader(configFileName);
logger.info("init from out config succeed for {}", configFileName);
} catch (Throwable e) {
in = new InputStreamReader(loder.getResourceAsStream(propertyFileName), "UTF-8");;
}
if (in != null) {
Properties prop = new Properties();
prop.load(in);

@ -27,7 +27,6 @@ import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
/**

@ -1,5 +1,5 @@
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses=http://172.22.62.105/internal/etl/xxl-job-admin
xxl.job.admin.addresses=https://172.22.62.105/internal/etl/xxl-job-admin
### xxl-job, access token
xxl.job.accessToken=default_token
@ -7,7 +7,7 @@ xxl.job.accessToken=default_token
### xxl-job executor appname
xxl.job.executor.appname=qpsy-interbase2
### xxl-job executor registry-address: default use address to registry , otherwise use ip:port if address is null
xxl.job.executor.address=http://172.22.62.105
xxl.job.executor.address=https://172.22.62.105
### xxl-job executor server-info
xxl.job.executor.ip=
xxl.job.executor.port=19998

@ -7,6 +7,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.wanhua.frameless.stationv3.jobhandler.StationV3CollectorJob;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
@ -71,8 +72,13 @@ public class StationV3CollectorJobConfig {
InputStreamReader in = null;
try {
ClassLoader loder = Thread.currentThread().getContextClassLoader();
in = new InputStreamReader(loder.getResourceAsStream(propertyFileName), "UTF-8");;
String configFileName = "config/"+propertyFileName;
try {
in = new FileReader(configFileName);
logger.info("init from out config succeed for {}", configFileName);
} catch (Throwable e) {
in = new InputStreamReader(loder.getResourceAsStream(propertyFileName), "UTF-8");;
}
if (in != null) {
Properties prop = new Properties();
prop.load(in);

Loading…
Cancel
Save