apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.54k stars 26.44k forks source link

[Bug] The Consul configCenter notification listener under dubbo-spi-extensions failed. #14868

Closed paradiseidler closed 1 week ago

paradiseidler commented 2 weeks ago

Pre-check

Search before asking

Apache Dubbo Component

Java SPI Extensions (apache/dubbo-spi-extensions)

Dubbo Version

Dubbo3.3.0 JDK 17

Steps to reproduce this issue

While rewriting the unit test for the testAddListener() method under the dubbo-spi-extension Consul configuration center, it was found that the unit test could not reach the code where the consulListener processes the notification listener. The same issue occurred with previous tests as well. discovery

What you expected to happen

When adding a listener to a node in the Consul configuration center, the newValues collection parameter in the notify method of the ConsulDynamicConfiguration class seems to have the key in a relative path format without the leading "/"(eg:dubbo/config/dubbo/foo), while the defined normalizedKey uses the absolute path with the "/"(eg:/dubbo/config/dubbo/foo), causing a mismatch between the two string values and leading to the failure of event notifications to the listener. bug

Anything else

No response

Are you willing to submit a pull request to fix on your own?

Code of Conduct