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
29cc7d93
Commit
29cc7d93
authored
Sep 13, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print env info for demo
parent
ab773f37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
ApolloConfigDemo.java
apollo-demo/src/main/java/ApolloConfigDemo.java
+9
-0
No files found.
apollo-demo/src/main/java/ApolloConfigDemo.java
View file @
29cc7d93
...
...
@@ -7,6 +7,7 @@ import com.ctrip.framework.apollo.ConfigService;
import
com.ctrip.framework.apollo.core.enums.ConfigFileFormat
;
import
com.ctrip.framework.apollo.model.ConfigChange
;
import
com.ctrip.framework.apollo.model.ConfigChangeEvent
;
import
com.ctrip.framework.foundation.Foundation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -76,8 +77,16 @@ public class ApolloConfigDemo {
System
.
out
.
println
(
configFile
.
getContent
());
}
private
void
printEnvInfo
()
{
String
message
=
String
.
format
(
"AppId: %s, Env: %s, DC: %s, IP: %s"
,
Foundation
.
app
()
.
getAppId
(),
Foundation
.
server
().
getEnvType
(),
Foundation
.
server
().
getDataCenter
(),
Foundation
.
net
().
getHostAddress
());
System
.
out
.
println
(
message
);
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
ApolloConfigDemo
apolloConfigDemo
=
new
ApolloConfigDemo
();
apolloConfigDemo
.
printEnvInfo
();
System
.
out
.
println
(
"Apollo Config Demo. Please input key to get the value."
);
while
(
true
)
{
...
...
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