-
Notifications
You must be signed in to change notification settings - Fork 26.6k
feat(registry): support the option, whether to check the connection … #15594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
7f027a8
2642ddb
3b84280
815f205
35b34fe
94633f0
94df8f9
083e045
ea46c99
474890b
7b9559e
0b6b9ef
1ca1f44
fb1ed51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| import org.apache.dubbo.common.URL; | ||
| import org.apache.dubbo.common.logger.ErrorTypeAwareLogger; | ||
| import org.apache.dubbo.common.logger.LoggerFactory; | ||
| import org.apache.dubbo.registry.RegistryFactory; | ||
| import org.apache.dubbo.registry.client.DefaultServiceInstance; | ||
| import org.apache.dubbo.registry.client.ServiceInstance; | ||
| import org.apache.dubbo.registry.nacos.NacosConnectionManager; | ||
|
|
@@ -114,8 +115,17 @@ public static NacosNamingServiceWrapper createNamingService(URL connectionURL) { | |
| boolean check = connectionURL.getParameter(NACOS_CHECK_KEY, true); | ||
| int retryTimes = connectionURL.getPositiveParameter(NACOS_RETRY_KEY, 10); | ||
| int sleepMsBetweenRetries = connectionURL.getPositiveParameter(NACOS_RETRY_WAIT_KEY, 10); | ||
| NacosConnectionManager nacosConnectionManager = | ||
| new NacosConnectionManager(connectionURL, check, retryTimes, sleepMsBetweenRetries); | ||
| NacosConnectionManager nacosConnectionManager; | ||
| try { | ||
| nacosConnectionManager = | ||
| new NacosConnectionManager(connectionURL, check, retryTimes, sleepMsBetweenRetries); | ||
| } catch (IllegalStateException e) { | ||
| if (RegistryFactory.isCheck(connectionURL)) { | ||
| throw e; | ||
| } | ||
| nacosConnectionManager = | ||
| new NacosConnectionManager(connectionURL, false, retryTimes, sleepMsBetweenRetries); | ||
|
||
| } | ||
| return new NacosNamingServiceWrapper(nacosConnectionManager, retryTimes, sleepMsBetweenRetries); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.