lordcheng10 commented on code in PR #17035:
URL: https://github.com/apache/pulsar/pull/17035#discussion_r963330549
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java:
##########
@@ -2113,33 +2114,44 @@ private void handlePoliciesUpdates(NamespaceName
namespace) {
}
private void handleDynamicConfigurationUpdates() {
-
pulsar().getPulsarResources().getDynamicConfigResources().getDynamicConfigurationAsync()
- .thenAccept(optMap -> {
- if (!optMap.isPresent()) {
- return;
- }
- Map<String, String> data = optMap.get();
- data.forEach((configKey, value) -> {
- Field configField =
dynamicConfigurationMap.get(configKey).field;
- Object newValue =
FieldParser.value(data.get(configKey), configField);
- if (configField != null) {
- Consumer listener =
configRegisteredListeners.get(configKey);
- try {
- Object existingValue =
configField.get(pulsar.getConfiguration());
- configField.set(pulsar.getConfiguration(),
newValue);
- log.info("Successfully updated configuration
{}/{}", configKey,
- data.get(configKey));
- if (listener != null &&
!existingValue.equals(newValue)) {
- listener.accept(newValue);
+ DynamicConfigurationResources dynamicConfigResources = null;
+ try {
+ dynamicConfigResources = pulsar()
+ .getPulsarResources()
+ .getDynamicConfigResources();
Review Comment:
handleDynamicConfigurationUpdates is executed via zk callbacks:
<img width="1202" alt="image"
src="https://user-images.githubusercontent.com/19296967/188569203-83ab4144-c50d-41cd-8eb2-4c6c6d4c9b6c.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]