From 1d064e8a1a61a0a4bbaf79dfd89caf227256a669 Mon Sep 17 00:00:00 2001 From: Martin Kuba Date: Thu, 20 Feb 2020 14:45:05 +0100 Subject: [PATCH] made engine and dispatcher names independent on IP address --- perun-db/oracle.sql | 6 +++--- perun-db/postgres.sql | 6 +++--- .../perun/dispatcher/processing/AuditerListener.java | 4 +--- perun-engine/src/main/resources/perun-engine.xml | 2 -- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/perun-db/oracle.sql b/perun-db/oracle.sql index a97056584e..5923bfb9a9 100644 --- a/perun-db/oracle.sql +++ b/perun-db/oracle.sql @@ -1789,11 +1789,11 @@ insert into action_types (id, action_type, description) values (action_types_seq insert into action_types (id, action_type, description) values (action_types_seq.nextval, 'write_public', 'Anyone can write, rewrite and remove value.'); -- insert default engine on default port -insert into engines (id, ip_address, port, last_check_in) VALUES (1, '127.0.0.1', 6061, sysdate); +insert into engines (id, ip_address, port, last_check_in) VALUES (1, 'engine1', 6061, sysdate); -- init default auditer consumers -insert into perun.auditer_consumers (id, name, last_processed_id) values (auditer_consumers_id_seq.nextval, '127.0.0.1:6071', 0); -- engine -insert into perun.auditer_consumers (id, name, last_processed_id) values (auditer_consumers_id_seq.nextval, 'notifications', 0); -- notification +insert into perun.auditer_consumers (id, name, last_processed_id) values (auditer_consumers_id_seq.nextval, 'dispatcher', 0); +insert into perun.auditer_consumers (id, name, last_processed_id) values (auditer_consumers_id_seq.nextval, 'notifications', 0); -- initial user, user_ext_source and internal ext_source insert into perun.ext_sources (id,name,type) values (ext_sources_id_seq.nextval,'INTERNAL','cz.metacentrum.perun.core.impl.ExtSourceInternal'); diff --git a/perun-db/postgres.sql b/perun-db/postgres.sql index 5783fbb1c1..fda133714c 100644 --- a/perun-db/postgres.sql +++ b/perun-db/postgres.sql @@ -1887,11 +1887,11 @@ insert into action_types (id, action_type, description) values (nextval('action_ insert into action_types (id, action_type, description) values (nextval('action_types_seq'), 'write_public', 'Anyone can write, rewrite and remove value.'); -- insert default engine on default port -insert into engines (id, ip_address, port, last_check_in) VALUES (1, '127.0.0.1', 6061, statement_timestamp()); +insert into engines (id, ip_address, port, last_check_in) VALUES (1, 'engine1', 6061, statement_timestamp()); -- init default auditer consumers -insert into perun.auditer_consumers (id, name, last_processed_id) values (nextval('auditer_consumers_id_seq'), '127.0.0.1:6071', 0); -- engine -insert into perun.auditer_consumers (id, name, last_processed_id) values (nextval('auditer_consumers_id_seq'), 'notifications', 0); -- notification +insert into perun.auditer_consumers (id, name, last_processed_id) values (nextval('auditer_consumers_id_seq'), 'dispatcher', 0); +insert into perun.auditer_consumers (id, name, last_processed_id) values (nextval('auditer_consumers_id_seq'), 'notifications', 0); -- initial user, user_ext_source and internal ext_source insert into perun.ext_sources (id,name,type) values (nextval('ext_sources_id_seq'),'INTERNAL','cz.metacentrum.perun.core.impl.ExtSourceInternal'); diff --git a/perun-dispatcher/src/main/java/cz/metacentrum/perun/dispatcher/processing/AuditerListener.java b/perun-dispatcher/src/main/java/cz/metacentrum/perun/dispatcher/processing/AuditerListener.java index 12916d6eeb..145436c482 100644 --- a/perun-dispatcher/src/main/java/cz/metacentrum/perun/dispatcher/processing/AuditerListener.java +++ b/perun-dispatcher/src/main/java/cz/metacentrum/perun/dispatcher/processing/AuditerListener.java @@ -84,8 +84,6 @@ public void run() { boolean whichOfTwoRules = false; - String dispatcherName = dispatcherProperties.getProperty("dispatcher.ip.address") + ":" + dispatcherProperties.getProperty("dispatcher.port"); - try { try { @@ -105,7 +103,7 @@ public void run() { while (!shouldStop()) { try { - for (AuditEvent message : perun.getAuditMessagesManager().pollConsumerEvents(sess, dispatcherName)) { + for (AuditEvent message : perun.getAuditMessagesManager().pollConsumerEvents(sess, "dispatcher")) { // create event for each message Event event = new Event(); event.setTimeStamp(System.currentTimeMillis()); diff --git a/perun-engine/src/main/resources/perun-engine.xml b/perun-engine/src/main/resources/perun-engine.xml index 2936fe28da..256197bfd0 100644 --- a/perun-engine/src/main/resources/perun-engine.xml +++ b/perun-engine/src/main/resources/perun-engine.xml @@ -62,8 +62,6 @@ http://www.springframework.org/schema/aop http://www.springframework.org/schema/ 1 - 127.0.0.1 - 6061 127.0.0.1 6071