From f43d61078e298e9cab45b6c408653a97156f732d Mon Sep 17 00:00:00 2001 From: riccardomodanese Date: Mon, 23 Oct 2023 13:03:48 +0200 Subject: [PATCH] fix(consumers): introduce $SYS prefix for events and services Signed-off-by: riccardomodanese --- .../broker-artemis/configurations/broker.xml | 27 +++++-------------- .../events-broker/configurations/broker.xml | 13 +++++---- .../security/ServiceClientMessagingImpl.java | 6 ++--- .../commons/event/jms/JMSServiceEventBus.java | 4 +-- .../src/main/resources/camel/camel.xml | 2 +- .../resources/spring/applicationContext.xml | 2 +- .../src/main/resources/camel/camel.xml | 2 +- .../resources/spring/applicationContext.xml | 2 +- .../src/main/resources/camel/camel.xml | 8 +++--- .../resources/spring/applicationContext.xml | 2 +- 10 files changed, 26 insertions(+), 42 deletions(-) diff --git a/assembly/broker-artemis/configurations/broker.xml b/assembly/broker-artemis/configurations/broker.xml index a98834d64c8..2a00e4a3d98 100644 --- a/assembly/broker-artemis/configurations/broker.xml +++ b/assembly/broker-artemis/configurations/broker.xml @@ -115,25 +115,10 @@ - - - $SYS/dlq - $SYS/expired - 0 - - -1 - 10 - PAGE - true - true - true - true - ANYCAST - - $SYS/dlq - $SYS/expired + $SYS/dlq/default + $SYS/dlq/expired 0 -1 @@ -166,14 +151,14 @@ -
+
- +
-
+
- +
diff --git a/assembly/events-broker/configurations/broker.xml b/assembly/events-broker/configurations/broker.xml index ee4e6566ec6..8bb74dde158 100644 --- a/assembly/events-broker/configurations/broker.xml +++ b/assembly/events-broker/configurations/broker.xml @@ -111,10 +111,9 @@ - - dlq - expired + $SYS/svc/dlq/default + $SYS/svc/dlq/expired 0 -1 @@ -129,14 +128,14 @@ -
+
- +
-
+
- +
diff --git a/client/security/src/main/java/org/eclipse/kapua/client/security/ServiceClientMessagingImpl.java b/client/security/src/main/java/org/eclipse/kapua/client/security/ServiceClientMessagingImpl.java index d5dd5b5b81b..6429e1f814a 100644 --- a/client/security/src/main/java/org/eclipse/kapua/client/security/ServiceClientMessagingImpl.java +++ b/client/security/src/main/java/org/eclipse/kapua/client/security/ServiceClientMessagingImpl.java @@ -40,8 +40,8 @@ public class ServiceClientMessagingImpl implements ServiceClient { private static final Logger logger = LoggerFactory.getLogger(ServiceClientMessagingImpl.class); - public static final String REQUEST_QUEUE = "auth_request"; - public static final String RESPONSE_QUEUE_PATTERN = "auth_response_%s_%s"; + public static final String REQUEST_QUEUE = "$SYS/svc/ath/request"; + public static final String RESPONSE_QUEUE_PATTERN = "$SYS/svc/ath/response/%s_%s"; private static final int TIMEOUT = 5000; @@ -49,7 +49,7 @@ public class ServiceClientMessagingImpl implements ServiceClient { public ServiceClientMessagingImpl(String clusterName, String requester) { //TODO change configuration (use service event broker for now) - String clientId = "auth-" + UUID.randomUUID().toString(); + String clientId = "svc-ath-" + UUID.randomUUID().toString(); String host = SystemSetting.getInstance().getString(SystemSettingKey.SERVICE_BUS_HOST, "events-broker"); int port = SystemSetting.getInstance().getInt(SystemSettingKey.SERVICE_BUS_PORT, 5672); String username = SystemSetting.getInstance().getString(SystemSettingKey.SERVICE_BUS_USERNAME, "username"); diff --git a/commons/src/main/java/org/eclipse/kapua/commons/event/jms/JMSServiceEventBus.java b/commons/src/main/java/org/eclipse/kapua/commons/event/jms/JMSServiceEventBus.java index 81edbb61ca9..8cafd1caf72 100644 --- a/commons/src/main/java/org/eclipse/kapua/commons/event/jms/JMSServiceEventBus.java +++ b/commons/src/main/java/org/eclipse/kapua/commons/event/jms/JMSServiceEventBus.java @@ -299,7 +299,7 @@ void publish(String address, ServiceEvent kapuaEvent) synchronized void subscribe(Subscription subscription) throws ServiceEventBusException { try { - String subscriptionStr = String.format("events.%s", subscription.getAddress()); + String subscriptionStr = String.format("$SYS/svc/evt/%s", subscription.getAddress()); // create a bunch of sessions to allow parallel event processing LOGGER.info("Subscribing to address {} - name {} ...", subscriptionStr, subscription.getName()); for (int i = 0; i < CONSUMER_POOL_SIZE; i++) { @@ -345,7 +345,7 @@ private class Sender { private MessageProducer jmsProducer; public Sender(Connection jmsConnection, String address) throws JMSException { - address = String.format("events.%s", address); + address = String.format("$SYS/svc/evt/%s", address); jmsSession = jmsConnection.createSession(false, Session.AUTO_ACKNOWLEDGE); Topic jmsTopic = jmsSession.createTopic(address); jmsProducer = jmsSession.createProducer(jmsTopic); diff --git a/consumer/lifecycle-app/src/main/resources/camel/camel.xml b/consumer/lifecycle-app/src/main/resources/camel/camel.xml index 6a7f12d1853..e150cd24ef6 100644 --- a/consumer/lifecycle-app/src/main/resources/camel/camel.xml +++ b/consumer/lifecycle-app/src/main/resources/camel/camel.xml @@ -53,7 +53,7 @@ - + diff --git a/consumer/lifecycle-app/src/main/resources/spring/applicationContext.xml b/consumer/lifecycle-app/src/main/resources/spring/applicationContext.xml index 42e080d4182..ce0dd47bc42 100644 --- a/consumer/lifecycle-app/src/main/resources/spring/applicationContext.xml +++ b/consumer/lifecycle-app/src/main/resources/spring/applicationContext.xml @@ -75,7 +75,7 @@ diff --git a/consumer/telemetry-app/src/main/resources/camel/camel.xml b/consumer/telemetry-app/src/main/resources/camel/camel.xml index 874bdafac43..0e10c622531 100644 --- a/consumer/telemetry-app/src/main/resources/camel/camel.xml +++ b/consumer/telemetry-app/src/main/resources/camel/camel.xml @@ -25,7 +25,7 @@ - + diff --git a/consumer/telemetry-app/src/main/resources/spring/applicationContext.xml b/consumer/telemetry-app/src/main/resources/spring/applicationContext.xml index 789ef1b2b96..621103b123b 100644 --- a/consumer/telemetry-app/src/main/resources/spring/applicationContext.xml +++ b/consumer/telemetry-app/src/main/resources/spring/applicationContext.xml @@ -72,7 +72,7 @@ diff --git a/service/authentication-app/src/main/resources/camel/camel.xml b/service/authentication-app/src/main/resources/camel/camel.xml index 801f70ee8f4..fce3f0a8d64 100644 --- a/service/authentication-app/src/main/resources/camel/camel.xml +++ b/service/authentication-app/src/main/resources/camel/camel.xml @@ -13,7 +13,7 @@ --> - + @@ -32,17 +32,17 @@ - + - + - + diff --git a/service/authentication-app/src/main/resources/spring/applicationContext.xml b/service/authentication-app/src/main/resources/spring/applicationContext.xml index f3c594c0961..6076a0c4b43 100644 --- a/service/authentication-app/src/main/resources/spring/applicationContext.xml +++ b/service/authentication-app/src/main/resources/spring/applicationContext.xml @@ -81,7 +81,7 @@