Commit bcd213d6 by Jason Song

fix properties file notification

parent 15e27550
...@@ -13,6 +13,7 @@ import com.google.common.reflect.TypeToken; ...@@ -13,6 +13,7 @@ import com.google.common.reflect.TypeToken;
import com.google.common.util.concurrent.RateLimiter; import com.google.common.util.concurrent.RateLimiter;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.ctrip.framework.apollo.ConfigFile;
import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.core.ConfigConsts;
import com.ctrip.framework.apollo.core.dto.ApolloConfigNotification; import com.ctrip.framework.apollo.core.dto.ApolloConfigNotification;
import com.ctrip.framework.apollo.core.dto.ServiceDTO; import com.ctrip.framework.apollo.core.dto.ServiceDTO;
...@@ -221,7 +222,16 @@ public class RemoteConfigLongPollService implements Initializable { ...@@ -221,7 +222,16 @@ public class RemoteConfigLongPollService implements Initializable {
if (Strings.isNullOrEmpty(notification.getNamespaceName())) { if (Strings.isNullOrEmpty(notification.getNamespaceName())) {
continue; continue;
} }
m_notifications.put(notification.getNamespaceName(), notification.getNotificationId()); String namespaceName = notification.getNamespaceName();
if (m_notifications.containsKey(namespaceName)) {
m_notifications.put(namespaceName, notification.getNotificationId());
}
//since .properties are filtered out by default, so we need to check if there is notification with .properties suffix
String namespaceNameWithPropertiesSuffix =
String.format("%s.%s", namespaceName, ConfigFileFormat.Properties.getValue());
if (m_notifications.containsKey(namespaceNameWithPropertiesSuffix)) {
m_notifications.put(namespaceNameWithPropertiesSuffix, notification.getNotificationId());
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment