Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
a148282a
Commit
a148282a
authored
Aug 24, 2016
by
张乐
Committed by
GitHub
Aug 24, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #388 from nobodyiam/client-change
Client change
parents
1fe24756
13b8e27d
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
22 additions
and
19 deletions
+22
-19
pom.xml
apollo-adminservice/pom.xml
+1
-1
pom.xml
apollo-assembly/pom.xml
+1
-1
pom.xml
apollo-biz/pom.xml
+1
-1
pom.xml
apollo-buildtools/pom.xml
+1
-1
README.md
apollo-client/README.md
+1
-1
pom.xml
apollo-client/pom.xml
+1
-1
DefaultConfig.java
...a/com/ctrip/framework/apollo/internals/DefaultConfig.java
+1
-1
RemoteConfigRepository.java
...ip/framework/apollo/internals/RemoteConfigRepository.java
+6
-3
SimpleConfig.java
...va/com/ctrip/framework/apollo/internals/SimpleConfig.java
+1
-1
ConfigUtil.java
...main/java/com/ctrip/framework/apollo/util/ConfigUtil.java
+2
-2
pom.xml
apollo-common/pom.xml
+1
-1
pom.xml
apollo-configservice/pom.xml
+1
-1
pom.xml
apollo-core/pom.xml
+1
-1
pom.xml
apollo-demo/pom.xml
+1
-1
pom.xml
apollo-portal/pom.xml
+1
-1
pom.xml
pom.xml
+1
-1
No files found.
apollo-adminservice/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-assembly/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-biz/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-biz
</artifactId>
...
...
apollo-buildtools/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-client/README.md
View file @
a148282a
...
...
@@ -88,7 +88,7 @@ If you need this functionality, you could specify the cluster as follows:
<dependency>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo-client
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
</dependency>
## III. Client Usage
...
...
apollo-client/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultConfig.java
View file @
a148282a
...
...
@@ -86,7 +86,7 @@ public class DefaultConfig extends AbstractConfig implements RepositoryChangeLis
}
if
(
value
==
null
&&
m_configProperties
.
get
()
==
null
)
{
logger
.
error
(
"Config initialization failed
, always return default value!"
);
logger
.
warn
(
"Could not load config from Apollo
, always return default value!"
);
}
return
value
==
null
?
defaultValue
:
value
;
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java
View file @
a148282a
...
...
@@ -131,6 +131,11 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
this
.
fireRepositoryChange
(
m_namespace
,
this
.
getConfig
());
}
if
(
current
!=
null
)
{
Cat
.
logEvent
(
String
.
format
(
"Apollo.Client.Configs.%s"
,
current
.
getNamespaceName
()),
current
.
getReleaseKey
());
}
transaction
.
setStatus
(
Message
.
SUCCESS
);
}
catch
(
Throwable
ex
)
{
transaction
.
setStatus
(
ex
);
...
...
@@ -157,7 +162,7 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
String
appId
=
m_configUtil
.
getAppId
();
String
cluster
=
m_configUtil
.
getCluster
();
String
dataCenter
=
m_configUtil
.
getDataCenter
();
Cat
.
logEvent
(
"Apollo.Client.Config
Info
"
,
STRING_JOINER
.
join
(
appId
,
cluster
,
m_namespace
));
Cat
.
logEvent
(
"Apollo.Client.Config
Meta
"
,
STRING_JOINER
.
join
(
appId
,
cluster
,
m_namespace
));
int
maxRetries
=
2
;
Throwable
exception
=
null
;
...
...
@@ -194,8 +199,6 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
ApolloConfig
result
=
response
.
getBody
();
Cat
.
logEvent
(
"Apollo.Client.ConfigLoaded."
+
result
.
getNamespaceName
(),
result
.
getReleaseKey
());
logger
.
debug
(
"Loaded config for {}: {}"
,
m_namespace
,
result
);
return
result
;
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/SimpleConfig.java
View file @
a148282a
...
...
@@ -55,7 +55,7 @@ public class SimpleConfig extends AbstractConfig implements RepositoryChangeList
@Override
public
String
getProperty
(
String
key
,
String
defaultValue
)
{
if
(
m_configProperties
==
null
)
{
logger
.
error
(
"Config initialization failed
, always return default value!"
);
logger
.
warn
(
"Could not load config from Apollo
, always return default value!"
);
return
defaultValue
;
}
return
this
.
m_configProperties
.
getProperty
(
key
,
defaultValue
);
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/util/ConfigUtil.java
View file @
a148282a
...
...
@@ -25,8 +25,8 @@ public class ConfigUtil {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ConfigUtil
.
class
);
private
int
refreshInterval
=
5
;
private
TimeUnit
refreshIntervalTimeUnit
=
TimeUnit
.
MINUTES
;
private
int
connectTimeout
=
5000
;
//5 seconds
private
int
readTimeout
=
10000
;
//10
seconds
private
int
connectTimeout
=
1000
;
//1 second
private
int
readTimeout
=
5000
;
//5
seconds
private
String
cluster
;
private
int
loadConfigQPS
=
2
;
//2 times per second
private
int
longPollQPS
=
2
;
//2 times per second
...
...
apollo-common/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-configservice/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-core/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-demo/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-demo
</artifactId>
...
...
apollo-portal/pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<relativePath>
../pom.xml
</relativePath>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
pom.xml
View file @
a148282a
...
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<version>
0.
0.1
0
</version>
<version>
0.
1.
0
</version>
<name>
Apollo
</name>
<packaging>
pom
</packaging>
<description>
Ctrip Configuration Center
</description>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment