Skip to content

Commit e9ca621

Browse files
committed
Adapt the config logger to also use kafka_properties
1 parent f54d914 commit e9ca621

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

services/alarm-config-logger/src/main/java/org/phoebus/alarm/logging/AlarmConfigLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public AlarmConfigLogger(String topic, String location, String remoteLocation) {
8686
root = new File(location, this.topic);
8787
root.mkdirs();
8888

89-
model = new AlarmClient(props.getProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG), this.topic);
89+
model = new AlarmClient(props.getProperty(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG), this.topic, props.getProperty("kafka_properties"));
9090
model.start();
9191

9292
initialize();

services/alarm-config-logger/src/main/java/org/phoebus/alarm/logging/AlarmConfigLoggingService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ private static void help() {
4444
System.out.println("-help - This text");
4545
System.out.println("-topics Accelerator - Alarm topics who's associated configuration is to be logged, they can be defined as a comma or colon separated list");
4646
System.out.println("-bootstrap.servers localhost:9092 - Kafka server address");
47+
System.out.println("-kafka_properties /opt/client.properties - Properties file to load kafka client settings from");
4748
System.out.println("-repo.location /tmp/alarm_repo - Location of the alarm configuration repository");
4849
System.out.println("-remote.location https://remote.git/repo - Location of the remote git alarm configuration repository");
4950
System.out.println("-username username - username for remote git repo");
@@ -105,6 +106,12 @@ public static void main(String[] original_args) throws InterruptedException {
105106
iter.remove();
106107
properties.put("bootstrap.servers", iter.next());
107108
iter.remove();
109+
} else if (cmd.equals("-kafka_properties")) {
110+
if (!iter.hasNext())
111+
throw new Exception("Missing -kafka_properties file name");
112+
iter.remove();
113+
properties.put("kafka_properties",iter.next());
114+
iter.remove();
108115
} else if (cmd.equals("-repo.location")) {
109116
if (!iter.hasNext())
110117
throw new Exception("Missing -repo.location local checkout location for alarm confing repo");

services/alarm-config-logger/src/main/resources/alarm_config_logger.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Kafka alarm topics
22
bootstrap.servers=localhost:9092
33
alarm_topics=Accelerator
4+
kafka_properties=
45

56
# Location of the git repo
67
local.location=/tmp/alarm_repo

0 commit comments

Comments
 (0)