Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
apollo
Commits
7947607b
Unverified
Commit
7947607b
authored
Feb 24, 2019
by
Jason Song
Committed by
GitHub
Feb 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version to 1.4.0-SNAPSHOT (#2003)
parent
c5eb3259
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
16 additions
and
142 deletions
+16
-142
apollo-adminservice/pom.xml
apollo-adminservice/pom.xml
+1
-1
apollo-adminservice/src/main/docker/Dockerfile
apollo-adminservice/src/main/docker/Dockerfile
+1
-1
apollo-assembly/pom.xml
apollo-assembly/pom.xml
+1
-1
apollo-biz/pom.xml
apollo-biz/pom.xml
+1
-1
apollo-buildtools/pom.xml
apollo-buildtools/pom.xml
+1
-1
apollo-client/README.md
apollo-client/README.md
+0
-126
apollo-client/pom.xml
apollo-client/pom.xml
+1
-1
apollo-common/pom.xml
apollo-common/pom.xml
+1
-1
apollo-configservice/pom.xml
apollo-configservice/pom.xml
+1
-1
apollo-configservice/src/main/docker/Dockerfile
apollo-configservice/src/main/docker/Dockerfile
+1
-1
apollo-core/pom.xml
apollo-core/pom.xml
+1
-1
apollo-demo/pom.xml
apollo-demo/pom.xml
+1
-1
apollo-mockserver/pom.xml
apollo-mockserver/pom.xml
+1
-1
apollo-openapi/pom.xml
apollo-openapi/pom.xml
+1
-1
apollo-portal/pom.xml
apollo-portal/pom.xml
+1
-1
apollo-portal/src/main/docker/Dockerfile
apollo-portal/src/main/docker/Dockerfile
+1
-1
pom.xml
pom.xml
+1
-1
No files found.
apollo-adminservice/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-adminservice/src/main/docker/Dockerfile
View file @
7947607b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
FROM
openjdk:8-jre-alpine
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
3.0
ENV
VERSION 1.
4.0-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
...
...
apollo-assembly/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-biz/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-biz
</artifactId>
<artifactId>
apollo-biz
</artifactId>
...
...
apollo-buildtools/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-client/README.md
deleted
100644 → 0
View file @
c5eb3259
## I. Prerequisite
### I.I Requirements
*
Java: 1.7+
### I.II Mandatory Setup
Apollo client requires
`AppId`
and
`Environment`
information available to function properly, so please read the following and configure them properly:
#### 1. AppId
AppId is the identity for the application, which is a key information to retrieve the config from server.
AppId information should be put in
`classpath:/META-INF/app.properties`
with its key as
`app.id`
.
For example, you could place the file as the following screenshot:

And config the file as:
> app.id=YOUR-APP-ID
#### 2. Environment
Apollo supports config by multiple environments, so environment is another key information to retrieve the config from server.
Environment could be configured in 3 ways:
1.
As Java System Property
*
You could specify environment as java system property
`env`
*
For example, when starting the java application, it can be configured via
`-Denv=YOUR-ENVIRONMENT`
*
Please note the key should be lower case
2.
As OS System Environment
*
You could also specify environment as system environment
`ENV`
*
Please note the key should be UPPER CASE
3.
As Property File
*
You could create a file
`/opt/settings/server.properties`
on the target machine
*
And specify the environment in the file as
`env=YOUR-ENVIRONMENT`
*
Please note the key should be lower case
Currently,
`env`
allows the following values (case-insensitive):
*
DEV
*
FWS
*
FAT
*
UAT
*
PRO
### I.III Optional Setup
#### Cluster
Apollo supports config separated by clusters, which means for one appId and one environment, you could have different configs.
If you need this functionality, you could specify the cluster as follows:
1.
As Java System Property
*
You could specify cluster as java system property
`apollo.cluster`
*
For example, when starting the java application, it can be configured via
`-Dapollo.cluster=xxx`
*
Please note the key should be lower case
2.
As Property file
*
You could create a file
`/opt/settings/server.properties`
on the target machine
*
And specify the idc cluster in the file as
`idc=xxx`
*
Please note the key should be lower case
##### Cluster Precedence
1.
If both
`apollo.cluster`
and
`idc`
are specified:
*
We will first try to load config from cluster specified as
`apollo.cluster`
*
If not found, we will fall back to cluster specified as
`idc`
*
If still not found, we will fall back to the default cluster
`default`
2.
If only
`apollo.cluster`
is specified:
*
We will first try to load config from cluster specified as
`apollo.cluster`
*
If not found, we will fall back to the default cluster
`default`
3.
If only
`idc`
is specified:
*
We will first try to load config from cluster specified as
`idc`
*
If not found, we will fall back to the default cluster
`default`
4.
If neither
`apollo.cluster`
nor
`idc`
is specified:
*
We will load config from the default cluster
`default`
## II. Maven Dependency
<dependency>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo-client
</artifactId>
<version>
1.3.0
</version>
</dependency>
## III. Client Usage
### 1. Load config from default namespace(application)
```
java
Config
config
=
ConfigService
.
getAppConfig
();
String
someKey
=
"someKeyFromDefaultNamespace"
;
String
someDefaultValue
=
"someDefaultValueForTheKey"
;
System
.
out
.
println
(
String
.
format
(
"Value for key %s is %s"
,
someKey
,
config
.
getProperty
(
someKey
,
someDefaultValue
)));
```
### 2. Register config change listener
```
java
Config
config
=
ConfigService
.
getAppConfig
();
config
.
addChangeListener
(
new
ConfigChangeListener
()
{
@Override
public
void
onChange
(
ConfigChangeEvent
changeEvent
)
{
System
.
out
.
println
(
"Changes for namespace "
+
changeEvent
.
getNamespace
());
for
(
String
key
:
changeEvent
.
changedKeys
())
{
ConfigChange
change
=
changeEvent
.
getChange
(
key
);
System
.
out
.
println
(
String
.
format
(
"Found change - key: %s, oldValue: %s, newValue: %s, changeType: %s"
,
change
.
getPropertyName
(),
change
.
getOldValue
(),
change
.
getNewValue
(),
change
.
getChangeType
()));
}
}
});
```
### 3. Load config from public namespace
```
java
String
somePublicNamespace
=
"CAT"
;
Config
config
=
ConfigService
.
getConfig
(
somePublicNamespace
);
String
someKey
=
"someKeyFromPublicNamespace"
;
String
someDefaultValue
=
"someDefaultValueForTheKey"
;
System
.
out
.
println
(
String
.
format
(
"Value for key %s is %s"
,
someKey
,
config
.
getProperty
(
someKey
,
someDefaultValue
)));
```
apollo-client/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-common/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-configservice/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-configservice/src/main/docker/Dockerfile
View file @
7947607b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
FROM
openjdk:8-jre-alpine
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
3.0
ENV
VERSION 1.
4.0-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
...
...
apollo-core/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-demo/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
apollo-demo
</artifactId>
<artifactId>
apollo-demo
</artifactId>
...
...
apollo-mockserver/pom.xml
View file @
7947607b
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-openapi/pom.xml
View file @
7947607b
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-portal/pom.xml
View file @
7947607b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<parent>
<parent>
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<relativePath>
../pom.xml
</relativePath>
<relativePath>
../pom.xml
</relativePath>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
apollo-portal/src/main/docker/Dockerfile
View file @
7947607b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
FROM
openjdk:8-jre-alpine
FROM
openjdk:8-jre-alpine
MAINTAINER
ameizi <sxyx2008@163.com>
MAINTAINER
ameizi <sxyx2008@163.com>
ENV
VERSION 1.
3.0
ENV
VERSION 1.
4.0-SNAPSHOT
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
RUN
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
&&
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
\
...
...
pom.xml
View file @
7947607b
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<groupId>
com.ctrip.framework.apollo
</groupId>
<groupId>
com.ctrip.framework.apollo
</groupId>
<artifactId>
apollo
</artifactId>
<artifactId>
apollo
</artifactId>
<version>
1.
3.0
</version>
<version>
1.
4.0-SNAPSHOT
</version>
<name>
Apollo
</name>
<name>
Apollo
</name>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<description>
Ctrip Configuration Center
</description>
<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