-
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 configuring apolloService and apolloCluster #3116
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3116 +/- ##
==========================================
Coverage 50.36% 50.36%
- Complexity 3114 3116 +2
==========================================
Files 594 594
Lines 19625 19625
Branches 2438 2437 -1
==========================================
Hits 9885 9885
Misses 8744 8744
Partials 996 996 |
@@ -54,17 +54,21 @@ | |||
private static final String APP_ID = "appId"; | |||
private static final String APOLLO_META = "apolloMeta"; | |||
private static final String APOLLO_SECRET = "apolloAccesskeySecret"; | |||
private static final String APOLLO_CLUSTER = "cluster"; |
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.
APOLLO_CLUSTER = "seata" Is that better?
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.
yes
namespace = "application" | ||
apolloAccesskeySecret = "" | ||
cluster = "cluster" |
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.
cluster = "seata" Is that better?
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.
change
@@ -176,6 +180,12 @@ private void readyApolloConfig() { | |||
System.setProperty(PROP_APOLLO_SECRET, secretKey); | |||
} | |||
} | |||
if (!properties.containsKey(APOLLO_CLUSTER)) { | |||
System.setProperty(PROP_APOLLO_CLUSTER, FILE_CONFIG.getConfig(getApolloCluster())); |
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.
If the value is ""?
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.
It is "default",the default value of apollo.
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.
It is "default",the default value of apollo.
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.
It is "default",the default value of apollo.
I mean, if it's empty, don't set it
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.
The apollo client will set 'default',if it's empty.
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.
The apollo client will set 'default',if it's empty.
System.setProperty(PROP_APOLLO_CLUSTER, FILE_CONFIG.getConfig(getApolloCluster())); | ||
} | ||
if (!properties.containsKey(APOLLO_CONFIG_SERVICE)) { | ||
System.setProperty(PROP_APOLLO_CONFIG_SERVICE, FILE_CONFIG.getConfig(getApolloConfigService())); |
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.
If the value is ""?
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.
It is empty.Apollo will use apolloMeta.If apolloMeta is empty.The addr of apollo will be null.
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
config/seata-config-apollo/src/main/java/io/seata/config/apollo/ApolloConfiguration.java
Show resolved
Hide resolved
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.
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.
Pls add those config items in yml/properties files
Codecov Report
@@ Coverage Diff @@
## develop #3116 +/- ##
==========================================
Coverage 50.91% 50.92%
Complexity 3287 3287
==========================================
Files 614 614
Lines 20148 20148
Branches 2522 2522
==========================================
+ Hits 10259 10261 +2
+ Misses 8859 8857 -2
Partials 1030 1030
|
+1 |
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.
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews