Java sample client startup and debugging in the Ctrip Apollo (Apollo) configuration Center

Source: Internet
Author: User
Tags custom name

Reference: https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97#23-java%E6%A0%B7%E4%BE% 8b%e5%ae%a2%e6%88%b7%e7%ab%af%e5%90%af%e5%8a%a8

The premise is to build a local machine environment first: http://www.cnblogs.com/EasonJim/p/7643630.html

Unzip import Eclipse:

The main use is Apollo-demo

Create a new app and profile entry in the configuration center background

Note: In the name of the two profiles, the first one is the default when you create a new app, and the key is to fill it in. The second option is to specify private mode when adding namespace to enter a custom name.

Go back to the Apollo-demo project and specify class to run, adding the following VM boot parameters:

After startup, you can see that the following information has been started remotely:

Why you need to pass two VM parameters for the following reasons:

1, the first parameter is used to specify the environment, env first through the/opt/settings/server.propertis specified to read, if not directly read the system Properties-D provided, if not, then you hang up.

2, because the use of the full set of code introduced to the demo project, so in the App-core for the Meta_server address takes the variable to read, and this variable provides the way the system attribute-D to provide. Over here:

And if you are using your own package to upload to the warehouse client, the client will eventually contain the core, these addresses are automatically specified, so no system attributes are required.

Java sample client startup and debugging in the Ctrip Apollo (Apollo) configuration Center

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.