Aias00 opened a new issue, #6488:
URL: https://github.com/apache/shenyu/issues/6488
### Current Behavior
The Apollo registry implementation updates its local instance cache for
added and deleted keys, but ignores modified keys.
`ApolloInstanceRegisterRepository.selectInstances()` registers a
`ConfigChangeListener` and handles only `ADDED` and `DELETED` events:
```java
switch (changeEvent.getChange(key).getChangeType()) {
case ADDED:
childrenList.put(key, changeEvent.getChange(key).getNewValue());
break;
case DELETED:
childrenList.remove(key);
break;
default:
break;
}
```
Apollo change events can also be `MODIFIED`. When an existing instance key
is updated, for example host, port, scheme, or other instance JSON fields
change while the key remains the same, the local `childrenList` is not updated.
### Expected Behavior
`MODIFIED` events should refresh the cached value for that instance key, the
same as an add/update cache write.
### Impact
Consumers of `selectInstances()` can keep using stale instance data until
the key is deleted/recreated or the process restarts and reloads the full
Apollo state.
### Code Location
-
`shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloInstanceRegisterRepository.java`
- `selectInstances()` listener ignores modified Apollo property changes.
--
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]