Я использую apache flink 1.10 для вычисления моих потоковых данных, теперь я хочу интегрировать Apollo (инструмент управления конфигурацией приложений) для управления моей конфигурацией. Документы apollo сообщают мне, что я могу передать app.id по:
-Dapp.id=YOUR-APP-ID
, поэтому теперь я пытаюсь добавить параметр запуска в свое приложение, но мгновение - это загрузить файл jar и автоматически запустить его так:
. так что я должен сделать, чтобы добавить параметр запуска этого приложения? это моя конфигурация gradle:
project(":rdw-flinkjob-consume") {
apply plugin: 'com.github.johnrengelman.shadow'
archivesBaseName = "rdw-flinkjob-consume"
version = "1.0.0-SNAPSHOT"
group = 'com.sportswin.rdw'
mainClassName = 'com.sportswin.rdw.WalletConsumeRealtimeHandler'
description = """Flink Quickstart Job"""
// NOTE: We cannot use "compileOnly" or "shadow" configurations since then we could not run code
// in the IDE or with "gradle run". We also cannot exclude transitive dependencies from the
// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
// -> Explicitly define the // libraries we want to be included in the "flinkShadowJar" configuration!
configurations {
flinkShadowJar // dependencies which go into the shadowJar
// always exclude these (also from transitive dependencies) since they are provided by Flink
// flinkShadowJar.exclude group: 'org.apache.flink', module: 'force-shading'
flinkShadowJar.exclude group: 'com.google.code.findbugs', module: 'jsr305'
flinkShadowJar.exclude group: 'org.slf4j'
flinkShadowJar.exclude group: 'log4j'
}
dependencies {
flinkShadowJar project(":rdw-flinkjob-common")
}
// make compileOnly dependencies available for tests:
sourceSets {
main.compileClasspath += configurations.flinkShadowJar
main.runtimeClasspath += configurations.flinkShadowJar
test.compileClasspath += configurations.flinkShadowJar
test.runtimeClasspath += configurations.flinkShadowJar
javadoc.classpath += configurations.flinkShadowJar
}
run.classpath = sourceSets.main.runtimeClasspath
jar {
manifest {
attributes 'Built-By': System.getProperty('user.name'),
'Build-Jdk': System.getProperty('java.version')
}
}
shadowJar {
configurations = [project.configurations.flinkShadowJar]
}
}
теперь журнал сервера всегда говорит мне, что я не передаю app.id
в него так:
2020-04-30 12:44:13,146 WARN com.ctrip.framework.apollo.internals.AbstractConfigRepository - Sync config failed, will retry. Repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository, reason: Load Apollo Config failed - appId: ApolloNoAppIdPlaceHolder, cluster: default, namespace: application, url: http://172.30.184.6:8080/configs/ApolloNoAppIdPlaceHolder/default/application?ip=172.30.184.16 [Cause: [status code: 404] Could not find config for namespace - appId: ApolloNoAppIdPlaceHolder, cluster: default, namespace: application, please check whether the configs are released in Apollo!]
2020-04-30 12:44:17,306 WARN com.ctrip.framework.apollo.util.ConfigUtil - app.id is not set, please make sure it is set in classpath:/META-INF/app.properties, now apollo will only load public namespace configurations!
2020-04-30 12:44:18,337 WARN com.ctrip.framework.apollo.util.ConfigUtil - app.id is not set, please make sure it is set in classpath:/META-INF/app.properties, now apollo will only load public namespace configurations!
2020-04-30 12:44:18,346 WARN com.ctrip.framework.apollo.internals.RemoteConfigRepository - Load config failed, will retry in 1 SECONDS. appId: ApolloNoAppIdPlaceHolder, cluster: default, namespaces: application
2020-04-30 12:44:19,354 WARN com.ctrip.framework.apollo.internals.AbstractConfigRepository - Sync config failed, will retry. Repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository, reason: Load Apollo Config failed - appId: ApolloNoAppIdPlaceHolder, cluster: default, namespace: application, url: http://172.30.184.6:8080/configs/ApolloNoAppIdPlaceHolder/default/application?ip=172.30.184.16 [Cause: [status code: 404] Could not find config for namespace - appId: ApolloNoAppIdPlaceHolder, cluster: default, namespace: application, please check whether the configs are released in Apollo!]
2020-04-30 12:44:34,440 WARN com.ctrip.framework.apollo.util.ConfigUtil - app.id is not set, please make sure it is set in classpath:/META-INF/app.properties, now apollo will only load public namespace configurations!