From 25d1cbc6c2ee46cfc9129652308d0b65b68f5b40 Mon Sep 17 00:00:00 2001
From: amichelo <andrea.michelotti@lnf.infn.it>
Date: Fri, 29 Oct 2021 18:24:00 +0200
Subject: [PATCH] fix for webui

---
 .../common/message/impl/kafka/rdk/MessagePSRDKafkaConsumer.cpp | 2 +-
 chaos/common/rpc/psm/PSMServer.cpp                             | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/chaos/common/message/impl/kafka/rdk/MessagePSRDKafkaConsumer.cpp b/chaos/common/message/impl/kafka/rdk/MessagePSRDKafkaConsumer.cpp
index ce53bba5e..3137ecd57 100644
--- a/chaos/common/message/impl/kafka/rdk/MessagePSRDKafkaConsumer.cpp
+++ b/chaos/common/message/impl/kafka/rdk/MessagePSRDKafkaConsumer.cpp
@@ -113,7 +113,7 @@ int MessagePSRDKafkaConsumer::applyConfiguration() {
     }*/
     if (rk == NULL) {
       MRDDBG_ << "Consumer apply configuration, groupid:" << groupid;
-      if (groupid != "") {
+      if (groupid.size()) {
         if (setOption("group.id", groupid.c_str()) != 0) {
           return -2;
         }
diff --git a/chaos/common/rpc/psm/PSMServer.cpp b/chaos/common/rpc/psm/PSMServer.cpp
index 09ac8323f..c37b59e98 100644
--- a/chaos/common/rpc/psm/PSMServer.cpp
+++ b/chaos/common/rpc/psm/PSMServer.cpp
@@ -70,7 +70,10 @@ void PSMServer::init(void *init_data) {
         gname=cfg->getStringValue(InitOption::OPT_GROUP_NAME);
         PSMS_LAPP << "belong to group:\""<<gname<<"\"";
 
+    } else {
+        gname=nodeuid;
     }
+
     cons = chaos::common::message::MessagePSDriver::getNewConsumerDriver(msgbrokerdrv, gname);
     prod = chaos::common::message::MessagePSDriver::getProducerDriver(msgbrokerdrv);
 
-- 
GitLab