-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
feature: support custom service name when registering with nacos #2379
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2379 +/- ##
=============================================
- Coverage 51.45% 51.43% -0.02%
+ Complexity 2664 2662 -2
=============================================
Files 529 529
Lines 16956 16956
Branches 2051 2051
=============================================
- Hits 8724 8722 -2
Misses 7408 7408
- Partials 824 826 +2
|
@@ -203,6 +205,14 @@ private static String getClusterName() { | |||
return cluster; | |||
} | |||
|
|||
private static String getServiceName() { | |||
String serviceName = FILE_CONFIG.getConfig(getNacosApplicationFileKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getConfig support defaultValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,i have already optimize it
@@ -43,10 +43,12 @@ | |||
public class NacosRegistryServiceImpl implements RegistryService<EventListener> { | |||
private static final String DEFAULT_NAMESPACE = ""; | |||
private static final String DEFAULT_CLUSTER = "default"; | |||
private static final String DEFAULT_APPLICATION = "seata"; | |||
private static final String PRO_SERVER_ADDR_KEY = "serverAddr"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be can remove unused.
@@ -43,10 +43,12 @@ | |||
public class NacosRegistryServiceImpl implements RegistryService<EventListener> { | |||
private static final String DEFAULT_NAMESPACE = ""; | |||
private static final String DEFAULT_CLUSTER = "default"; | |||
private static final String DEFAULT_APPLICATION = "seata"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about seata-server
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,i will optimize it
@@ -3,6 +3,7 @@ registry { | |||
type = "file" | |||
|
|||
nacos { | |||
application = "seata" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where your client configuration item application
… with nacos, add the client configuration
Thx, i have already add the client configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
please resolve code conflicts |
i have already resolve the code conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… with nacos
Ⅰ. Describe what this PR did
Set configurable service name automatically when registering with nacos
Ⅱ. Does this pull request fix one issue?
fixes #2355
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews