Aias00 opened a new issue, #6838:
URL: https://github.com/apache/shenyu/issues/6838
## Description
`ApolloDataService` registers `configService.addChangeListener(listener,
emptySet, ApolloPathConstants.pathKeySet())` passing **bare** data IDs
(`"plugin"`, `"selector"`, `"rule"`, `"auth"`, `"meta"`, `"proxy.selector"`,
`"discovery"`) as `interestedKeyPrefixes`. Apollo's
`AbstractConfig.isConfigChangeListenerInterested` checks
`changedKey.startsWith(prefix)`. Actual property keys are namespace-prefixed
(`namespaceId + "." + dataId + "." + ...`, e.g. `649330b6-….plugin.pluginName`)
per `AbstractNodeDataSyncService:86-96`, so `startsWith("plugin")` is **false**
— the listener is never notified for incremental changes. Even if notified, the
handler body checks `changeKey.indexOf(PLUGIN_DATA_ID) == 0`, which also fails
for namespaced keys. Startup loading via `getProperty` still works; only
incremental changes are dropped. The unit tests bypass Apollo's filtering by
invoking the captured listener directly with unrealistic keys.
## Location
-
`shenyu-sync-data-center/shenyu-sync-data-apollo/src/main/java/org/apache/shenyu/sync/data/apollo/ApolloDataService.java:102-144`
(handler), `:150` (registration)
-
`shenyu-common/src/main/java/org/apache/shenyu/common/constant/ApolloPathConstants.java:37-67`
-
`shenyu-sync-data-center/shenyu-sync-data-api/src/main/java/org/apache/shenyu/sync/data/core/AbstractNodeDataSyncService.java:86-96`
(namespaced keys)
## Impact
After initial startup load, ALL incremental Apollo change events
(plugin/selector/rule/meta/auth/proxy/discovery) are silently dropped. The
gateway never receives any config change until full restart. Apollo sync is
effectively static-only. Security-relevant changes (auth/plugin disable) won't
apply until restart.
## Suggested fix
Register prefixes that include the namespace prefix (e.g. `namespaceId + "."
+ PLUGIN_DATA_ID`), and change the handler `indexOf==0` checks to
`changeKey.startsWith(namespaceId + "." + PLUGIN_DATA_ID)`; add an integration
test that flows through Apollo's real filtering.
## Related existing
None — filed Apollo items concern long-polling/websocket, not Apollo prefix
matching.
--
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]