You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2017/12/12 09:18:21 UTC

[24/57] [partial] incubator-servicecomb-website git commit: Generated the static pages for asf-site

http://git-wip-us.apache.org/repos/asf/incubator-servicecomb-website/blob/08e1b43f/content/cn/users/service-heartbeat/index.html
----------------------------------------------------------------------
diff --git a/content/cn/users/service-heartbeat/index.html b/content/cn/users/service-heartbeat/index.html
new file mode 100644
index 0000000..84d8417
--- /dev/null
+++ b/content/cn/users/service-heartbeat/index.html
@@ -0,0 +1,709 @@
+<!doctype html>
+<!--
+  Minimal Mistakes Jekyll Theme 4.4.1 by Michael Rose
+  Copyright 2017 Michael Rose - mademistakes.com | @mmistakes
+  Free for personal and commercial use under the MIT license
+  https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
+-->
+<html lang="cn" class="no-js">
+  <head>
+    <meta charset="utf-8">
+
+<!-- begin SEO -->
+
+
+
+
+
+
+
+
+
+<title>服务心跳 - Apache incubator ServiceComb</title>
+
+
+
+
+<meta name="description" content="服务心跳">
+
+
+
+
+<meta name="author" content="">
+
+<meta property="og:locale" content="cn">
+<meta property="og:site_name" content="Apache incubator ServiceComb">
+<meta property="og:title" content="服务心跳">
+
+
+  <link rel="canonical" href="http://github.com/pages/ServiceComb/servicesomb.github.io/cn/users/service-heartbeat/">
+  <meta property="og:url" content="http://github.com/pages/ServiceComb/servicesomb.github.io/cn/users/service-heartbeat/">
+
+
+
+  <meta property="og:description" content="服务心跳">
+
+
+
+  <meta name="twitter:site" content="@ServiceComb">
+  <meta name="twitter:title" content="服务心跳">
+  <meta name="twitter:description" content="服务心跳">
+  <meta name="twitter:url" content="">
+
+  
+    <meta name="twitter:card" content="summary">
+    
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  <script type="application/ld+json">
+    {
+      "@context" : "http://schema.org",
+      "@type" : "Person",
+      "name" : "Apache incubator ServiceComb",
+      "url" : "http://github.com/pages/ServiceComb/servicesomb.github.io",
+      "sameAs" : null
+    }
+  </script>
+
+
+
+  <meta name="google-site-verification" content="HvJjNd7vvJ-yjSTHlBiIWEYxp_Hrz-PYEY5Idz9LRcA" />
+
+
+
+
+<!-- end SEO -->
+
+
+<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache incubator ServiceComb Feed">
+
+<!-- http://t.co/dKP3o1e -->
+<meta name="HandheldFriendly" content="True">
+<meta name="MobileOptimized" content="320">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<script>
+  document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
+</script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script>
+<script src="/assets/js/prism.js"></script>
+
+<script type="text/javascript" async
+  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
+</script>
+
+<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
+
+<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
+<!-- For all browsers -->
+<link rel="stylesheet" href="/assets/css/main.css">
+<link rel="stylesheet" href="/assets/css/prism.css">
+
+<!--[if lte IE 9]>
+  <style>
+    /* old IE unsupported flexbox fixes */
+    .greedy-nav .site-title {
+      padding-right: 3em;
+    }
+    .greedy-nav button {
+      position: absolute;
+      top: 0;
+      right: 0;
+      height: 100%;
+    }
+  </style>
+<![endif]-->
+
+<meta http-equiv="cleartype" content="on">
+
+    <!-- start custom head snippets -->
+
+<!-- insert favicons. use http://realfavicongenerator.net/ -->
+<link href="https://fonts.cat.net/css?family=Roboto:400,500,700|Source+Code+Pro" rel="stylesheet">
+<script src="/assets/js/custom.js"></script>
+<!-- end custom head snippets -->
+
+  </head>
+
+  <body class="layout--single">
+
+    <!--[if lt IE 9]>
+<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
+<![endif]-->
+    <div class="masthead">
+  <div class="masthead__inner-wrap">
+    <div class="masthead__menu">
+      <nav id="site-nav" class="greedy-nav">
+	      
+          <a class="site-title active" href="/cn"><img src="//assets/images/ServiceComb-logo-1.png"></a>
+	      
+        <ul class="visible-links">
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/docs/quick-start/">快速入门</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a class="active" href="/cn/users/">用户手册</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/developers/">开发者手册</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/year-archive/">博文</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/faqs/">常见问题</a>
+              
+            </li>
+          
+        </ul>
+        <button><div class="navicon"></div></button>
+        <ul class="hidden-links hidden"></ul>
+        <div class="nav-lang">
+          
+            
+            
+            <a href=/users/service-heartbeat/>English</a>
+          
+        </div>
+      </nav>
+    </div>
+  </div>
+</div>
+
+
+    
+
+
+
+<div id="main" role="main">
+  
+  <div class="sidebar sticky">
+      
+      <div class="back-to-home">首页 > <a href="/cn/">ServiceComb</a></div>
+      
+  
+  
+    
+      
+      
+      
+    
+    
+      
+
+<nav class="nav__list">
+  
+  <input id="ac-toc" name="accordion-toc" type="checkbox" />
+  <label for="ac-toc">切换菜单</label>
+  <ul class="nav__items">
+    
+      <li>
+        
+          <span class="nav__sub-title">用户手册</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/" class="">Java Chassis系统架构</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/setup-environment/" class="">环境配置</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">开发服务提供者</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-definition/" class="">服务定义</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-contract/" class="">服务契约</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-springmvc/" class="">用SpringMVC开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-jax-rs/" class="">用JAX-RS开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-transparent-rpc/" class="">用透明RPC开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-interface-constraints/" class="">服务接口约束</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-configurations/" class="">服务配置</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/communicate-protocol/" class="">通信协议</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/application-boot-process/" class="">程序启动逻辑</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-heartbeat/" class="active">服务心跳</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">开发服务消费者</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-rest-template/" class="">使用Rest Template方式开发</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-rpc/" class="">使用RPC方式开发</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-service-contract/" class="">使用服务契约</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/invoke-control/" class="">调用控制</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">通用开发</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/local-develop-test/" class="">本地开发与测试</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-servicecomb-in-spring-boot/" class="">在Spring Boot中使用ServiceComb</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/distributed-tracing/" class="">分布式调用链追踪</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/customized-tracing/" class="">自定义调用链打点</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">服务能力开放</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/edging-service/nginx/" class="">使用confd和Nginx做边缘服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/edging-service/zuul/" class="">使用Zuul做边缘服务</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          
+          
+
+          <a href="/cn/users/metrics/"><span class="nav__sub-title nav__sub-title-with-url">监控</span></a>
+        
+
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">部署</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/run-mode/" class="">运行模式</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">微服务安全</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-tls/" class="">使用TLS通信</a></li>
+          
+        </ul>
+        
+      </li>
+    
+  </ul>
+</nav>
+
+    
+  
+  </div>
+
+
+
+  <article class="page" itemscope itemtype="http://schema.org/CreativeWork">
+    <meta itemprop="headline" content="服务心跳">
+    <meta itemprop="description" content="服务心跳">
+    
+    <meta itemprop="dateModified" content="August 15, 2017">
+
+    <div class="page__inner-wrap">
+      
+        
+          <header>
+            <h1 class="page__title" itemprop="headline">服务心跳
+</h1>
+            
+          </header>
+        
+      
+
+      <section class="page__content" itemprop="text">
+        <aside class="sidebar__right">
+<nav class="toc">
+    <!-- <header><h4 class="nav__title"><i class="fa fa-file-text"></i> 在本页上</h4></header> -->
+<ul class="toc__menu" id="markdown-toc">
+  <li><a href="#场景描述" id="markdown-toc-场景描述">场景描述</a></li>
+  <li><a href="#涉及api" id="markdown-toc-涉及api">涉及API</a></li>
+  <li><a href="#配置说明" id="markdown-toc-配置说明">配置说明</a></li>
+</ul>
+
+  </nav>
+</aside>
+
+<h2 id="场景描述">场景描述</h2>
+
+<p>当微服务实例注册到服务中心后,微服务需要定时向服务中心发送心跳。若服务中心在一定时间内没有收到心跳信息,则会注销此实例。</p>
+
+<h2 id="涉及api">涉及API</h2>
+
+<ul>
+  <li><code class="highlighter-rouge">io.servicecomb.serviceregistry.client.ServiceRegistryClient</code>:服务中心客户端</li>
+</ul>
+
+<h2 id="配置说明">配置说明</h2>
+
+<p><code class="highlighter-rouge">ServiceRegistryClient</code>提供了发送心跳的方法<code class="highlighter-rouge">heartbeat</code>,用户直接调用即可,示例代码如下:</p>
+
+<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="kd">throws</span> <span class="n">Exception</span> <span class="o">{</span>
+  <span class="c1">// 首先需要注册微服务和实例</span>
+  <span class="c1">// 发送心跳,不然实例会消失</span>
+  <span class="k">while</span> <span class="o">(</span><span class="kc">true</span><span class="o">)</span> <span class="o">{</span>
+    <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"heartbeat sended:"</span> <span class="o">+</span> <span class="n">client</span><span class="o">.</span><span class="na">heartbeat</span><span class="o">(</span><span class="n">service2</span><span class="o">.</span><span class="na">getServiceId</span><span class="o">(),</span> <span class="n">instance</span><span class="o">.</span><span class="na">getInstanceId</span><span class="o">()));</span>
+    <span class="n">Thread</span><span class="o">.</span><span class="na">sleep</span><span class="o">(</span><span class="mi">3000</span><span class="o">);</span>
+  <span class="o">}</span>
+<span class="o">}</span>
+</code></pre>
+</div>
+
+        
+      </section>
+
+      <footer class="page__meta">
+        
+        
+
+
+        
+      </footer>
+
+      
+
+      
+
+    </div>
+
+    
+  </article>
+
+  
+  
+</div>
+
+
+    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
+    <div align="center" style="margin: 0 0;">
+    <ins class="adsbygoogle"
+         style="display:block; border-bottom: initial;"
+         data-ad-client="ca-pub-7328585512091257"
+         data-ad-slot="3049671934"
+         data-ad-format="auto"></ins>
+    </div>
+
+    <div class="page__footer">
+      <footer>
+        <!-- start custom footer snippets -->
+
+<!-- end custom footer snippets -->
+        <div class="container">
+  <div class="row justify-content-md-center">
+    
+    <div class="col">
+      <ul>
+        <p class="header">资源</p>
+        <li><a href="/cn/docs/quick-start/">快速入门</a></li>
+        <li><a href="/cn/users/user-guide/">用户指南</a></li>
+        <li><a href="/cn/slides/">资料</a></li>
+        <li><a href="/cn/users/faq/">常见问题</a></li>
+      </ul>
+    </div>
+    <div class="col">
+      <ul>
+        <p class="header">贡献</p>
+        <li><a href="https://github.com/ServiceComb/ServiceComb.github.io/issues/new?title=Issue with _users/cn/service-heartbeat.md">报告本网页问题</a></li>
+        <li><a href="https://github.com/ServiceComb/ServiceComb.github.io/edit/master/_users/cn/service-heartbeat.md">在Github上编辑此页</a></li>
+        <li><a href="/cn/developers/submit-codes/">代码提交指南</a></li>
+      </ul>
+    </div>
+    <div class="col">
+      <ul class="social-icons">
+        <p class="header">社区</p>
+        <li>
+            <a href="https://groups.google.com/forum/#!forum/servicecomb-developers" target="_blank"><span class="group">开发者</span></a> |
+            <a href="https://groups.google.com/forum/#!forum/servicecomb-users" target="_blank">用户</span></a>
+        </li>
+        <li>
+            <a href="http://github.com/ServiceComb" target="_blank"><span class="github">Github</span></a>
+        </li>
+        <li>
+            <a href="https://twitter.com/ServiceComb" target="_blank"><span class="twitter">Twitter</span></a>
+        </li>
+        <li>
+            <a href="/feed.xml" target="_blank"><span class="rss">Feed</span></a>
+        </li>
+      </ul>
+    </div>
+  </div>
+</div>
+<div class="page__footer-bottom">
+  <div>&copy; 2017 Apache incubator ServiceComb. 技术来自于 <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
+</div>
+
+      </footer>
+    </div>
+
+    <script src="/assets/js/main.min.js"></script>
+
+
+
+
+  <script>
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-101622733-1', 'auto');
+  ga('send', 'pageview');
+</script>
+
+
+
+
+
+
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-servicecomb-website/blob/08e1b43f/content/cn/users/service-interface-constraints/index.html
----------------------------------------------------------------------
diff --git a/content/cn/users/service-interface-constraints/index.html b/content/cn/users/service-interface-constraints/index.html
new file mode 100644
index 0000000..b85127a
--- /dev/null
+++ b/content/cn/users/service-interface-constraints/index.html
@@ -0,0 +1,753 @@
+<!doctype html>
+<!--
+  Minimal Mistakes Jekyll Theme 4.4.1 by Michael Rose
+  Copyright 2017 Michael Rose - mademistakes.com | @mmistakes
+  Free for personal and commercial use under the MIT license
+  https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
+-->
+<html lang="cn" class="no-js">
+  <head>
+    <meta charset="utf-8">
+
+<!-- begin SEO -->
+
+
+
+
+
+
+
+
+
+<title>服务接口约束 - Apache incubator ServiceComb</title>
+
+
+
+
+<meta name="description" content="服务接口约束">
+
+
+
+
+<meta name="author" content="">
+
+<meta property="og:locale" content="cn">
+<meta property="og:site_name" content="Apache incubator ServiceComb">
+<meta property="og:title" content="服务接口约束">
+
+
+  <link rel="canonical" href="http://github.com/pages/ServiceComb/servicesomb.github.io/cn/users/service-interface-constraints/">
+  <meta property="og:url" content="http://github.com/pages/ServiceComb/servicesomb.github.io/cn/users/service-interface-constraints/">
+
+
+
+  <meta property="og:description" content="服务接口约束">
+
+
+
+  <meta name="twitter:site" content="@ServiceComb">
+  <meta name="twitter:title" content="服务接口约束">
+  <meta name="twitter:description" content="服务接口约束">
+  <meta name="twitter:url" content="">
+
+  
+    <meta name="twitter:card" content="summary">
+    
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  <script type="application/ld+json">
+    {
+      "@context" : "http://schema.org",
+      "@type" : "Person",
+      "name" : "Apache incubator ServiceComb",
+      "url" : "http://github.com/pages/ServiceComb/servicesomb.github.io",
+      "sameAs" : null
+    }
+  </script>
+
+
+
+  <meta name="google-site-verification" content="HvJjNd7vvJ-yjSTHlBiIWEYxp_Hrz-PYEY5Idz9LRcA" />
+
+
+
+
+<!-- end SEO -->
+
+
+<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache incubator ServiceComb Feed">
+
+<!-- http://t.co/dKP3o1e -->
+<meta name="HandheldFriendly" content="True">
+<meta name="MobileOptimized" content="320">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<script>
+  document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
+</script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script>
+<script src="/assets/js/prism.js"></script>
+
+<script type="text/javascript" async
+  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
+</script>
+
+<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
+
+<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
+<!-- For all browsers -->
+<link rel="stylesheet" href="/assets/css/main.css">
+<link rel="stylesheet" href="/assets/css/prism.css">
+
+<!--[if lte IE 9]>
+  <style>
+    /* old IE unsupported flexbox fixes */
+    .greedy-nav .site-title {
+      padding-right: 3em;
+    }
+    .greedy-nav button {
+      position: absolute;
+      top: 0;
+      right: 0;
+      height: 100%;
+    }
+  </style>
+<![endif]-->
+
+<meta http-equiv="cleartype" content="on">
+
+    <!-- start custom head snippets -->
+
+<!-- insert favicons. use http://realfavicongenerator.net/ -->
+<link href="https://fonts.cat.net/css?family=Roboto:400,500,700|Source+Code+Pro" rel="stylesheet">
+<script src="/assets/js/custom.js"></script>
+<!-- end custom head snippets -->
+
+  </head>
+
+  <body class="layout--single">
+
+    <!--[if lt IE 9]>
+<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
+<![endif]-->
+    <div class="masthead">
+  <div class="masthead__inner-wrap">
+    <div class="masthead__menu">
+      <nav id="site-nav" class="greedy-nav">
+	      
+          <a class="site-title active" href="/cn"><img src="//assets/images/ServiceComb-logo-1.png"></a>
+	      
+        <ul class="visible-links">
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/docs/quick-start/">快速入门</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a class="active" href="/cn/users/">用户手册</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/developers/">开发者手册</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/year-archive/">博文</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/faqs/">常见问题</a>
+              
+            </li>
+          
+        </ul>
+        <button><div class="navicon"></div></button>
+        <ul class="hidden-links hidden"></ul>
+        <div class="nav-lang">
+          
+            
+            
+            <a href=/users/service-interface-constraints/>English</a>
+          
+        </div>
+      </nav>
+    </div>
+  </div>
+</div>
+
+
+    
+
+
+
+<div id="main" role="main">
+  
+  <div class="sidebar sticky">
+      
+      <div class="back-to-home">首页 > <a href="/cn/">ServiceComb</a></div>
+      
+  
+  
+    
+      
+      
+      
+    
+    
+      
+
+<nav class="nav__list">
+  
+  <input id="ac-toc" name="accordion-toc" type="checkbox" />
+  <label for="ac-toc">切换菜单</label>
+  <ul class="nav__items">
+    
+      <li>
+        
+          <span class="nav__sub-title">用户手册</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/" class="">Java Chassis系统架构</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/setup-environment/" class="">环境配置</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">开发服务提供者</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-definition/" class="">服务定义</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-contract/" class="">服务契约</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-springmvc/" class="">用SpringMVC开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-jax-rs/" class="">用JAX-RS开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-transparent-rpc/" class="">用透明RPC开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-interface-constraints/" class="active">服务接口约束</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-configurations/" class="">服务配置</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/communicate-protocol/" class="">通信协议</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/application-boot-process/" class="">程序启动逻辑</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-heartbeat/" class="">服务心跳</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">开发服务消费者</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-rest-template/" class="">使用Rest Template方式开发</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-rpc/" class="">使用RPC方式开发</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-service-contract/" class="">使用服务契约</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/invoke-control/" class="">调用控制</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">通用开发</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/local-develop-test/" class="">本地开发与测试</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-servicecomb-in-spring-boot/" class="">在Spring Boot中使用ServiceComb</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/distributed-tracing/" class="">分布式调用链追踪</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/customized-tracing/" class="">自定义调用链打点</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">服务能力开放</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/edging-service/nginx/" class="">使用confd和Nginx做边缘服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/edging-service/zuul/" class="">使用Zuul做边缘服务</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          
+          
+
+          <a href="/cn/users/metrics/"><span class="nav__sub-title nav__sub-title-with-url">监控</span></a>
+        
+
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">部署</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/run-mode/" class="">运行模式</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">微服务安全</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-tls/" class="">使用TLS通信</a></li>
+          
+        </ul>
+        
+      </li>
+    
+  </ul>
+</nav>
+
+    
+  
+  </div>
+
+
+
+  <article class="page" itemscope itemtype="http://schema.org/CreativeWork">
+    <meta itemprop="headline" content="服务接口约束">
+    <meta itemprop="description" content="服务接口约束">
+    
+    <meta itemprop="dateModified" content="August 15, 2017">
+
+    <div class="page__inner-wrap">
+      
+        
+          <header>
+            <h1 class="page__title" itemprop="headline">服务接口约束
+</h1>
+            
+          </header>
+        
+      
+
+      <section class="page__content" itemprop="text">
+        <aside class="sidebar__right">
+<nav class="toc">
+    <!-- <header><h4 class="nav__title"><i class="fa fa-file-text"></i> 在本页上</h4></header> -->
+<ul class="toc__menu" id="markdown-toc">
+  <li><a href="#接口约束说明" id="markdown-toc-接口约束说明">接口约束说明</a></li>
+  <li><a href="#详细的约束列表" id="markdown-toc-详细的约束列表">详细的约束列表</a></li>
+  <li><a href="#协议上的差异" id="markdown-toc-协议上的差异">协议上的差异</a></li>
+</ul>
+
+  </nav>
+</aside>
+
+<h2 id="接口约束说明">接口约束说明</h2>
+<p>Java Chassis对于接口的使用约束建立在一个简单的原则上:接口定义即接口使用说明,不用通过查看代码实现,就能识别如何调用这个接口。举个例子:</p>
+
+<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="kd">public</span> <span class="n">Person</span> <span class="nf">query</span><span class="o">(</span><span class="n">String</span> <span class="n">id</span><span class="o">);</span>
+<span class="kd">public</span> <span class="n">Object</span> <span class="nf">query</span><span class="o">(</span><span class="n">String</span> <span class="n">id</span><span class="o">);</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">Person</span> <span class="o">{</span><span class="n">String</span> <span class="n">name</span><span class="o">;}</span>
+</code></pre>
+</div>
+
+<p>显然如果调用接口一,我们知道要传递一个String类型的id参数,返回值是一个Person类型,Person里面存在String类型的name等参数。如果调用接口二,我们不知道怎么处理返回值,必须参考服务提供者的文档说明。可以看出,我们是站在使用者视角这边的,以更容易被使用作为参考。</p>
+
+<p>当我们要将接口发布为REST接口的时候,可以通过使用swagger文件,指定id使用RequestParam或者PathVariable或者RequestBody进行传递,也可以使用SpringMVC或者JAX RS提供的标签来描述。</p>
+
+<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="kd">public</span> <span class="n">Person</span> <span class="nf">query</span><span class="o">(</span><span class="nd">@RequestParam</span> <span class="n">String</span> <span class="n">id</span><span class="o">);</span> 
+<span class="kd">public</span> <span class="n">Person</span> <span class="nf">query</span><span class="o">(</span><span class="nd">@PathVariable</span> <span class="n">String</span> <span class="n">id</span><span class="o">);</span> 
+<span class="kd">public</span> <span class="n">Person</span> <span class="nf">query</span><span class="o">(</span><span class="nd">@RequestBody</span> <span class="n">String</span> <span class="n">id</span><span class="o">);</span> 
+</code></pre>
+</div>
+
+<p>通常,我们会将简单的数据类型,比如String, int等在RequestParam或者PathVariable传递,而把复杂的数据类型使用JSON编码以后在RequestBody传递,以减少HTTP协议限制可能给开发者带来的各种问题。</p>
+
+<h2 id="详细的约束列表">详细的约束列表</h2>
+<p>开发者不能在接口定义的时候使用如下类型:</p>
+
+<ul>
+  <li>比较抽象的数据结构: java.lang.Object, net.sf.json.JsonObject等</li>
+  <li>接口或者抽象类
+    <div class="language-java highlighter-rouge"><pre class="highlight"><code> <span class="kd">public</span> <span class="kd">interface</span> <span class="nc">IPerson</span> <span class="o">{...}</span>
+ <span class="kd">public</span> <span class="kd">abstract</span> <span class="kd">class</span> <span class="nc">AbstractPerson</span>  <span class="o">{...}</span>
+</code></pre>
+    </div>
+  </li>
+  <li>泛型
+    <div class="language-java highlighter-rouge"><pre class="highlight"><code> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">PersonHolder</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span> <span class="o">{...}</span>
+</code></pre>
+    </div>
+  </li>
+  <li>
+    <p>上述类型的集合类型或者没指定类型的集合,比如:<code class="highlighter-rouge">List&lt;IPerson&gt;, Map&lt;String, PersonHolder&lt;?&gt;&gt;, List, Map</code>等。 <code class="highlighter-rouge">List&lt;String&gt;, List&lt;Person&gt;</code>这些具体类型是支持的。</p>
+  </li>
+  <li>包含上述类型作为属性的类型
+    <div class="language-java highlighter-rouge"><pre class="highlight"><code> <span class="kd">public</span> <span class="kd">class</span> <span class="nc">GroupOfPerson</span> <span class="o">{</span><span class="n">IPerson</span> <span class="n">master</span> <span class="o">...}</span>
+</code></pre>
+    </div>
+  </li>
+</ul>
+
+<p>开发者不用担心记不住这些约束,程序会在启动的时候检查不支持的类型,并给与错误提示。</p>
+
+<h2 id="协议上的差异">协议上的差异</h2>
+<p>尽管ServiceComb-Java-Chassis实现了不同协议之间开发方式的透明,受限于底层协议的限制,不同的协议存在少量差异。</p>
+
+<ul>
+  <li>
+    <p>map,key只支持string</p>
+  </li>
+  <li>highway (protobuf限制)
+    <ol>
+      <li>不支持在网络上传递null,包括Collection、array中的元素,map的value</li>
+      <li>长度为0的数组、list,不会在网络上传递,接收端解码出来就是默认值</li>
+    </ol>
+  </li>
+  <li>springmvc
+    <ol>
+      <li>不支持Date作为path、query参数。 因为springmvc直接将Date做toString放在path、query中,与swagger的标准不匹配。</li>
+    </ol>
+  </li>
+</ul>
+
+        
+      </section>
+
+      <footer class="page__meta">
+        
+        
+
+
+        
+      </footer>
+
+      
+
+      
+
+    </div>
+
+    
+  </article>
+
+  
+  
+</div>
+
+
+    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
+    <div align="center" style="margin: 0 0;">
+    <ins class="adsbygoogle"
+         style="display:block; border-bottom: initial;"
+         data-ad-client="ca-pub-7328585512091257"
+         data-ad-slot="3049671934"
+         data-ad-format="auto"></ins>
+    </div>
+
+    <div class="page__footer">
+      <footer>
+        <!-- start custom footer snippets -->
+
+<!-- end custom footer snippets -->
+        <div class="container">
+  <div class="row justify-content-md-center">
+    
+    <div class="col">
+      <ul>
+        <p class="header">资源</p>
+        <li><a href="/cn/docs/quick-start/">快速入门</a></li>
+        <li><a href="/cn/users/user-guide/">用户指南</a></li>
+        <li><a href="/cn/slides/">资料</a></li>
+        <li><a href="/cn/users/faq/">常见问题</a></li>
+      </ul>
+    </div>
+    <div class="col">
+      <ul>
+        <p class="header">贡献</p>
+        <li><a href="https://github.com/ServiceComb/ServiceComb.github.io/issues/new?title=Issue with _users/cn/service-interface-constraints.md">报告本网页问题</a></li>
+        <li><a href="https://github.com/ServiceComb/ServiceComb.github.io/edit/master/_users/cn/service-interface-constraints.md">在Github上编辑此页</a></li>
+        <li><a href="/cn/developers/submit-codes/">代码提交指南</a></li>
+      </ul>
+    </div>
+    <div class="col">
+      <ul class="social-icons">
+        <p class="header">社区</p>
+        <li>
+            <a href="https://groups.google.com/forum/#!forum/servicecomb-developers" target="_blank"><span class="group">开发者</span></a> |
+            <a href="https://groups.google.com/forum/#!forum/servicecomb-users" target="_blank">用户</span></a>
+        </li>
+        <li>
+            <a href="http://github.com/ServiceComb" target="_blank"><span class="github">Github</span></a>
+        </li>
+        <li>
+            <a href="https://twitter.com/ServiceComb" target="_blank"><span class="twitter">Twitter</span></a>
+        </li>
+        <li>
+            <a href="/feed.xml" target="_blank"><span class="rss">Feed</span></a>
+        </li>
+      </ul>
+    </div>
+  </div>
+</div>
+<div class="page__footer-bottom">
+  <div>&copy; 2017 Apache incubator ServiceComb. 技术来自于 <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
+</div>
+
+      </footer>
+    </div>
+
+    <script src="/assets/js/main.min.js"></script>
+
+
+
+
+  <script>
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-101622733-1', 'auto');
+  ga('send', 'pageview');
+</script>
+
+
+
+
+
+
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-servicecomb-website/blob/08e1b43f/content/cn/users/setup-environment/index.html
----------------------------------------------------------------------
diff --git a/content/cn/users/setup-environment/index.html b/content/cn/users/setup-environment/index.html
new file mode 100644
index 0000000..8d18382
--- /dev/null
+++ b/content/cn/users/setup-environment/index.html
@@ -0,0 +1,752 @@
+<!doctype html>
+<!--
+  Minimal Mistakes Jekyll Theme 4.4.1 by Michael Rose
+  Copyright 2017 Michael Rose - mademistakes.com | @mmistakes
+  Free for personal and commercial use under the MIT license
+  https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
+-->
+<html lang="cn" class="no-js">
+  <head>
+    <meta charset="utf-8">
+
+<!-- begin SEO -->
+
+
+
+
+
+
+
+
+
+<title>环境配置 - Apache incubator ServiceComb</title>
+
+
+
+
+<meta name="description" content="环境配置">
+
+
+
+
+<meta name="author" content="">
+
+<meta property="og:locale" content="cn">
+<meta property="og:site_name" content="Apache incubator ServiceComb">
+<meta property="og:title" content="环境配置">
+
+
+  <link rel="canonical" href="http://github.com/pages/ServiceComb/servicesomb.github.io/cn/users/setup-environment/">
+  <meta property="og:url" content="http://github.com/pages/ServiceComb/servicesomb.github.io/cn/users/setup-environment/">
+
+
+
+  <meta property="og:description" content="环境配置">
+
+
+
+  <meta name="twitter:site" content="@ServiceComb">
+  <meta name="twitter:title" content="环境配置">
+  <meta name="twitter:description" content="环境配置">
+  <meta name="twitter:url" content="">
+
+  
+    <meta name="twitter:card" content="summary">
+    
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  <script type="application/ld+json">
+    {
+      "@context" : "http://schema.org",
+      "@type" : "Person",
+      "name" : "Apache incubator ServiceComb",
+      "url" : "http://github.com/pages/ServiceComb/servicesomb.github.io",
+      "sameAs" : null
+    }
+  </script>
+
+
+
+  <meta name="google-site-verification" content="HvJjNd7vvJ-yjSTHlBiIWEYxp_Hrz-PYEY5Idz9LRcA" />
+
+
+
+
+<!-- end SEO -->
+
+
+<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache incubator ServiceComb Feed">
+
+<!-- http://t.co/dKP3o1e -->
+<meta name="HandheldFriendly" content="True">
+<meta name="MobileOptimized" content="320">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<script>
+  document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
+</script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script>
+<script src="/assets/js/prism.js"></script>
+
+<script type="text/javascript" async
+  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
+</script>
+
+<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
+
+<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
+<!-- For all browsers -->
+<link rel="stylesheet" href="/assets/css/main.css">
+<link rel="stylesheet" href="/assets/css/prism.css">
+
+<!--[if lte IE 9]>
+  <style>
+    /* old IE unsupported flexbox fixes */
+    .greedy-nav .site-title {
+      padding-right: 3em;
+    }
+    .greedy-nav button {
+      position: absolute;
+      top: 0;
+      right: 0;
+      height: 100%;
+    }
+  </style>
+<![endif]-->
+
+<meta http-equiv="cleartype" content="on">
+
+    <!-- start custom head snippets -->
+
+<!-- insert favicons. use http://realfavicongenerator.net/ -->
+<link href="https://fonts.cat.net/css?family=Roboto:400,500,700|Source+Code+Pro" rel="stylesheet">
+<script src="/assets/js/custom.js"></script>
+<!-- end custom head snippets -->
+
+  </head>
+
+  <body class="layout--single">
+
+    <!--[if lt IE 9]>
+<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
+<![endif]-->
+    <div class="masthead">
+  <div class="masthead__inner-wrap">
+    <div class="masthead__menu">
+      <nav id="site-nav" class="greedy-nav">
+	      
+          <a class="site-title active" href="/cn"><img src="//assets/images/ServiceComb-logo-1.png"></a>
+	      
+        <ul class="visible-links">
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/docs/quick-start/">快速入门</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a class="active" href="/cn/users/">用户手册</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/developers/">开发者手册</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/year-archive/">博文</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/faqs/">常见问题</a>
+              
+            </li>
+          
+        </ul>
+        <button><div class="navicon"></div></button>
+        <ul class="hidden-links hidden"></ul>
+        <div class="nav-lang">
+          
+            
+            
+            <a href=/users/setup-environment/>English</a>
+          
+        </div>
+      </nav>
+    </div>
+  </div>
+</div>
+
+
+    
+
+
+
+<div id="main" role="main">
+  
+  <div class="sidebar sticky">
+      
+      <div class="back-to-home">首页 > <a href="/cn/">ServiceComb</a></div>
+      
+  
+  
+    
+      
+      
+      
+    
+    
+      
+
+<nav class="nav__list">
+  
+  <input id="ac-toc" name="accordion-toc" type="checkbox" />
+  <label for="ac-toc">切换菜单</label>
+  <ul class="nav__items">
+    
+      <li>
+        
+          <span class="nav__sub-title">用户手册</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/" class="">Java Chassis系统架构</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/setup-environment/" class="active">环境配置</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">开发服务提供者</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-definition/" class="">服务定义</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-contract/" class="">服务契约</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-springmvc/" class="">用SpringMVC开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-jax-rs/" class="">用JAX-RS开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-transparent-rpc/" class="">用透明RPC开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-interface-constraints/" class="">服务接口约束</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-configurations/" class="">服务配置</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/communicate-protocol/" class="">通信协议</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/application-boot-process/" class="">程序启动逻辑</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-heartbeat/" class="">服务心跳</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">开发服务消费者</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-rest-template/" class="">使用Rest Template方式开发</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-rpc/" class="">使用RPC方式开发</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-service-contract/" class="">使用服务契约</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/invoke-control/" class="">调用控制</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">通用开发</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/local-develop-test/" class="">本地开发与测试</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-servicecomb-in-spring-boot/" class="">在Spring Boot中使用ServiceComb</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/distributed-tracing/" class="">分布式调用链追踪</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/customized-tracing/" class="">自定义调用链打点</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">服务能力开放</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/edging-service/nginx/" class="">使用confd和Nginx做边缘服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/edging-service/zuul/" class="">使用Zuul做边缘服务</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          
+          
+
+          <a href="/cn/users/metrics/"><span class="nav__sub-title nav__sub-title-with-url">监控</span></a>
+        
+
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">部署</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/run-mode/" class="">运行模式</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">微服务安全</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-tls/" class="">使用TLS通信</a></li>
+          
+        </ul>
+        
+      </li>
+    
+  </ul>
+</nav>
+
+    
+  
+  </div>
+
+
+
+  <article class="page" itemscope itemtype="http://schema.org/CreativeWork">
+    <meta itemprop="headline" content="环境配置">
+    <meta itemprop="description" content="环境配置">
+    
+    <meta itemprop="dateModified" content="September 03, 2017">
+
+    <div class="page__inner-wrap">
+      
+        
+          <header>
+            <h1 class="page__title" itemprop="headline">环境配置
+</h1>
+            
+          </header>
+        
+      
+
+      <section class="page__content" itemprop="text">
+        <aside class="sidebar__right">
+<nav class="toc">
+    <!-- <header><h4 class="nav__title"><i class="fa fa-file-text"></i> 在本页上</h4></header> -->
+<ul class="toc__menu" id="markdown-toc">
+  <li><a href="#安装java开发环境" id="markdown-toc-安装java开发环境">安装Java开发环境</a></li>
+  <li><a href="#运行service-center" id="markdown-toc-运行service-center">运行<em>Service Center</em></a></li>
+</ul>
+
+  </nav>
+</aside>
+
+<h2 id="安装java开发环境">安装Java开发环境</h2>
+
+<ul>
+  <li>
+    <p>安装git,详情可参考<a href="https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git">git安装教程</a></p>
+  </li>
+  <li>
+    <p>安装JDK 1.8,详情可参考<a href="https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html" target="_blank">JDK安装教程</a>。</p>
+  </li>
+  <li>
+    <p>安装Maven 3.x,详情可参考<a href="https://maven.apache.org/install.html" target="_blank">Maven安装教程</a>。</p>
+  </li>
+  <li>
+    <p>安装IntelliJ Idea IDE,详情可参考<a href="https://www.jetbrains.com/help/idea/installing-and-launching.html" target="_blank">IntelliJ安装教程</a>。</p>
+  </li>
+</ul>
+
+<h2 id="运行service-center">运行<em>Service Center</em></h2>
+<p>运行Service Center有以下两种方式:</p>
+
+<ol>
+  <li>
+    <p>以可执行文件的方式运行</p>
+
+    <ul class="nav nav-tabs">
+  <li data-toggle="tab" class="active"><a data-toggle="tab" href="#windows">Windows</a></li>
+  <li data-toggle="tab"><a data-toggle="tab" href="#linux">Linux</a></li>
+</ul>
+
+    <div class="tab-content">
+  <div id="windows" class="tab-pane active">
+        <ol>
+          <li>下载<a href="https://github.com/ServiceComb/service-center/releases/download/0.1.1/service-center-0.1.1-windows-amd64.zip">服务注册中心可执行文件压缩包</a></li>
+          <li>解压缩到当前文件夹</li>
+          <li>进入解压缩后的目录,然后双击运行<strong>start</strong>文件</li>
+        </ol>
+      </div>
+  <div id="linux" class="tab-pane fade">
+        <ol>
+          <li>下载服务注册中心可执行文件压缩包并解压缩
+            <div class="language-bash highlighter-rouge"><pre class="highlight"><code>wget https://github.com/ServiceComb/service-center/releases/download/0.1.1/service-center-0.1.1-linux-amd64.tar.gz
+tar xvf service-center-0.1.1-linux-amd64.tar.gz
+</code></pre>
+            </div>
+          </li>
+          <li>运行服务注册中心
+            <div class="language-bash highlighter-rouge"><pre class="highlight"><code>bash service-center-0.1.1-linux-amd64/start.sh
+</code></pre>
+            </div>
+          </li>
+        </ol>
+      </div>
+</div>
+
+    <p class="notice--warning">注意:Window和Linux版本均只支持64位系统。</p>
+  </li>
+  <li>
+    <p>以Docker的方式运行</p>
+  </li>
+</ol>
+
+<div class="language-bash highlighter-rouge"><pre class="highlight"><code>docker pull servicecomb/service-center
+docker run -d -p 30100:30100 servicecomb/service-center:latest
+</code></pre>
+</div>
+
+<p class="notice--warning"><strong>注意事项:</strong> 服务注册中心运行后绑定的IP为:<em>http://127.0.0.1:30100</em>。<br />
+如使用Docker Toolbox,可通过 <code class="highlighter-rouge">docker-machine ip</code> 获取服务绑定IP地址。</p>
+
+        
+      </section>
+
+      <footer class="page__meta">
+        
+        
+
+
+        
+      </footer>
+
+      
+
+      
+
+    </div>
+
+    
+  </article>
+
+  
+  
+</div>
+
+
+    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
+    <div align="center" style="margin: 0 0;">
+    <ins class="adsbygoogle"
+         style="display:block; border-bottom: initial;"
+         data-ad-client="ca-pub-7328585512091257"
+         data-ad-slot="3049671934"
+         data-ad-format="auto"></ins>
+    </div>
+
+    <div class="page__footer">
+      <footer>
+        <!-- start custom footer snippets -->
+
+<!-- end custom footer snippets -->
+        <div class="container">
+  <div class="row justify-content-md-center">
+    
+    <div class="col">
+      <ul>
+        <p class="header">资源</p>
+        <li><a href="/cn/docs/quick-start/">快速入门</a></li>
+        <li><a href="/cn/users/user-guide/">用户指南</a></li>
+        <li><a href="/cn/slides/">资料</a></li>
+        <li><a href="/cn/users/faq/">常见问题</a></li>
+      </ul>
+    </div>
+    <div class="col">
+      <ul>
+        <p class="header">贡献</p>
+        <li><a href="https://github.com/ServiceComb/ServiceComb.github.io/issues/new?title=Issue with _users/cn/setup-environment.md">报告本网页问题</a></li>
+        <li><a href="https://github.com/ServiceComb/ServiceComb.github.io/edit/master/_users/cn/setup-environment.md">在Github上编辑此页</a></li>
+        <li><a href="/cn/developers/submit-codes/">代码提交指南</a></li>
+      </ul>
+    </div>
+    <div class="col">
+      <ul class="social-icons">
+        <p class="header">社区</p>
+        <li>
+            <a href="https://groups.google.com/forum/#!forum/servicecomb-developers" target="_blank"><span class="group">开发者</span></a> |
+            <a href="https://groups.google.com/forum/#!forum/servicecomb-users" target="_blank">用户</span></a>
+        </li>
+        <li>
+            <a href="http://github.com/ServiceComb" target="_blank"><span class="github">Github</span></a>
+        </li>
+        <li>
+            <a href="https://twitter.com/ServiceComb" target="_blank"><span class="twitter">Twitter</span></a>
+        </li>
+        <li>
+            <a href="/feed.xml" target="_blank"><span class="rss">Feed</span></a>
+        </li>
+      </ul>
+    </div>
+  </div>
+</div>
+<div class="page__footer-bottom">
+  <div>&copy; 2017 Apache incubator ServiceComb. 技术来自于 <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
+</div>
+
+      </footer>
+    </div>
+
+    <script src="/assets/js/main.min.js"></script>
+
+
+
+
+  <script>
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-101622733-1', 'auto');
+  ga('send', 'pageview');
+</script>
+
+
+
+
+
+
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-servicecomb-website/blob/08e1b43f/content/cn/users/use-service-contract/index.html
----------------------------------------------------------------------
diff --git a/content/cn/users/use-service-contract/index.html b/content/cn/users/use-service-contract/index.html
new file mode 100644
index 0000000..9655bcb
--- /dev/null
+++ b/content/cn/users/use-service-contract/index.html
@@ -0,0 +1,742 @@
+<!doctype html>
+<!--
+  Minimal Mistakes Jekyll Theme 4.4.1 by Michael Rose
+  Copyright 2017 Michael Rose - mademistakes.com | @mmistakes
+  Free for personal and commercial use under the MIT license
+  https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
+-->
+<html lang="cn" class="no-js">
+  <head>
+    <meta charset="utf-8">
+
+<!-- begin SEO -->
+
+
+
+
+
+
+
+
+
+<title>使用服务契约 - Apache incubator ServiceComb</title>
+
+
+
+
+<meta name="description" content="使用服务契约">
+
+
+
+
+<meta name="author" content="">
+
+<meta property="og:locale" content="cn">
+<meta property="og:site_name" content="Apache incubator ServiceComb">
+<meta property="og:title" content="使用服务契约">
+
+
+  <link rel="canonical" href="http://github.com/pages/ServiceComb/servicesomb.github.io/cn/users/use-service-contract/">
+  <meta property="og:url" content="http://github.com/pages/ServiceComb/servicesomb.github.io/cn/users/use-service-contract/">
+
+
+
+  <meta property="og:description" content="使用服务契约">
+
+
+
+  <meta name="twitter:site" content="@ServiceComb">
+  <meta name="twitter:title" content="使用服务契约">
+  <meta name="twitter:description" content="使用服务契约">
+  <meta name="twitter:url" content="">
+
+  
+    <meta name="twitter:card" content="summary">
+    
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  <script type="application/ld+json">
+    {
+      "@context" : "http://schema.org",
+      "@type" : "Person",
+      "name" : "Apache incubator ServiceComb",
+      "url" : "http://github.com/pages/ServiceComb/servicesomb.github.io",
+      "sameAs" : null
+    }
+  </script>
+
+
+
+  <meta name="google-site-verification" content="HvJjNd7vvJ-yjSTHlBiIWEYxp_Hrz-PYEY5Idz9LRcA" />
+
+
+
+
+<!-- end SEO -->
+
+
+<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache incubator ServiceComb Feed">
+
+<!-- http://t.co/dKP3o1e -->
+<meta name="HandheldFriendly" content="True">
+<meta name="MobileOptimized" content="320">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<script>
+  document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
+</script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script>
+<script src="/assets/js/prism.js"></script>
+
+<script type="text/javascript" async
+  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
+</script>
+
+<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
+
+<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
+<!-- For all browsers -->
+<link rel="stylesheet" href="/assets/css/main.css">
+<link rel="stylesheet" href="/assets/css/prism.css">
+
+<!--[if lte IE 9]>
+  <style>
+    /* old IE unsupported flexbox fixes */
+    .greedy-nav .site-title {
+      padding-right: 3em;
+    }
+    .greedy-nav button {
+      position: absolute;
+      top: 0;
+      right: 0;
+      height: 100%;
+    }
+  </style>
+<![endif]-->
+
+<meta http-equiv="cleartype" content="on">
+
+    <!-- start custom head snippets -->
+
+<!-- insert favicons. use http://realfavicongenerator.net/ -->
+<link href="https://fonts.cat.net/css?family=Roboto:400,500,700|Source+Code+Pro" rel="stylesheet">
+<script src="/assets/js/custom.js"></script>
+<!-- end custom head snippets -->
+
+  </head>
+
+  <body class="layout--single">
+
+    <!--[if lt IE 9]>
+<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
+<![endif]-->
+    <div class="masthead">
+  <div class="masthead__inner-wrap">
+    <div class="masthead__menu">
+      <nav id="site-nav" class="greedy-nav">
+	      
+          <a class="site-title active" href="/cn"><img src="//assets/images/ServiceComb-logo-1.png"></a>
+	      
+        <ul class="visible-links">
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/docs/quick-start/">快速入门</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a class="active" href="/cn/users/">用户手册</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/developers/">开发者手册</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/year-archive/">博文</a>
+              
+            </li>
+          
+            
+            <li class="masthead__menu-item">
+              
+              
+              
+                <a href="/cn/faqs/">常见问题</a>
+              
+            </li>
+          
+        </ul>
+        <button><div class="navicon"></div></button>
+        <ul class="hidden-links hidden"></ul>
+        <div class="nav-lang">
+          
+            
+            
+            <a href=/users/use-service-contract/>English</a>
+          
+        </div>
+      </nav>
+    </div>
+  </div>
+</div>
+
+
+    
+
+
+
+<div id="main" role="main">
+  
+  <div class="sidebar sticky">
+      
+      <div class="back-to-home">首页 > <a href="/cn/">ServiceComb</a></div>
+      
+  
+  
+    
+      
+      
+      
+    
+    
+      
+
+<nav class="nav__list">
+  
+  <input id="ac-toc" name="accordion-toc" type="checkbox" />
+  <label for="ac-toc">切换菜单</label>
+  <ul class="nav__items">
+    
+      <li>
+        
+          <span class="nav__sub-title">用户手册</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/" class="">Java Chassis系统架构</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/setup-environment/" class="">环境配置</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">开发服务提供者</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-definition/" class="">服务定义</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-contract/" class="">服务契约</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-springmvc/" class="">用SpringMVC开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-jax-rs/" class="">用JAX-RS开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-transparent-rpc/" class="">用透明RPC开发微服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-interface-constraints/" class="">服务接口约束</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-configurations/" class="">服务配置</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/communicate-protocol/" class="">通信协议</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/application-boot-process/" class="">程序启动逻辑</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/service-heartbeat/" class="">服务心跳</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">开发服务消费者</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-rest-template/" class="">使用Rest Template方式开发</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/develop-with-rpc/" class="">使用RPC方式开发</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-service-contract/" class="active">使用服务契约</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/invoke-control/" class="">调用控制</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">通用开发</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/local-develop-test/" class="">本地开发与测试</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-servicecomb-in-spring-boot/" class="">在Spring Boot中使用ServiceComb</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/distributed-tracing/" class="">分布式调用链追踪</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/customized-tracing/" class="">自定义调用链打点</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">服务能力开放</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/edging-service/nginx/" class="">使用confd和Nginx做边缘服务</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/edging-service/zuul/" class="">使用Zuul做边缘服务</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          
+          
+
+          <a href="/cn/users/metrics/"><span class="nav__sub-title nav__sub-title-with-url">监控</span></a>
+        
+
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">部署</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/run-mode/" class="">运行模式</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">微服务安全</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/cn/users/use-tls/" class="">使用TLS通信</a></li>
+          
+        </ul>
+        
+      </li>
+    
+  </ul>
+</nav>
+
+    
+  
+  </div>
+
+
+
+  <article class="page" itemscope itemtype="http://schema.org/CreativeWork">
+    <meta itemprop="headline" content="使用服务契约">
+    <meta itemprop="description" content="使用服务契约">
+    
+    <meta itemprop="dateModified" content="August 15, 2017">
+
+    <div class="page__inner-wrap">
+      
+        
+          <header>
+            <h1 class="page__title" itemprop="headline">使用服务契约
+</h1>
+            
+          </header>
+        
+      
+
+      <section class="page__content" itemprop="text">
+        <aside class="sidebar__right">
+<nav class="toc">
+    <!-- <header><h4 class="nav__title"><i class="fa fa-file-text"></i> 在本页上</h4></header> -->
+<ul class="toc__menu" id="markdown-toc">
+  <li><a href="#场景描述" id="markdown-toc-场景描述">场景描述</a></li>
+  <li><a href="#配置说明" id="markdown-toc-配置说明">配置说明</a>    <ul>
+      <li><a href="#配置依赖服务" id="markdown-toc-配置依赖服务">配置依赖服务</a></li>
+      <li><a href="#手工配置服务契约" id="markdown-toc-手工配置服务契约">手工配置服务契约</a></li>
+      <li><a href="#从服务中心自动下载契约" id="markdown-toc-从服务中心自动下载契约">从服务中心自动下载契约</a></li>
+    </ul>
+  </li>
+</ul>
+
+  </nav>
+</aside>
+
+<h2 id="场景描述">场景描述</h2>
+
+<p>当服务消费者调用服务提供者的服务时,需要注册服务契约。消费者有两种方式获取提供者的服务契约,一种是从服务的提供方离线获取契约文件,手工配置到项目中;另一种是从服务中心自动下载契约。</p>
+
+<h2 id="配置说明">配置说明</h2>
+
+<blockquote>
+  <p>说明:服务契约的获取方式与服务消费者的开发方式是无关的,用户可以任意组合使用。</p>
+</blockquote>
+
+<h3 id="配置依赖服务">配置依赖服务</h3>
+
+<p>服务消费者需要在microservice.yaml文件中配置依赖的provider,示例配置如下:</p>
+
+<div class="language-yaml highlighter-rouge"><pre class="highlight"><code><span class="s">cse</span><span class="pi">:</span>
+  <span class="c1"># other configurations omitted</span>
+  <span class="s">references</span><span class="pi">:</span>
+    <span class="s">springmvc</span><span class="pi">:</span>
+      <span class="s">version-rule</span><span class="pi">:</span> <span class="s">0.0.1</span>
+</code></pre>
+</div>
+
+<blockquote>
+  <p>version-rule是版本匹配规则,有四种格式:</p>
+
+  <ul>
+    <li>精确版本匹配:例如<code class="highlighter-rouge">version-rule: 0.0.1</code>,表示只匹配版本号为0.0.1的服务提供者</li>
+    <li>后续版本匹配:例如<code class="highlighter-rouge">version-rule: 1.0.0+</code>,表示匹配版本号大于或等于1.0.0的服务提供者</li>
+    <li>最新版本:<code class="highlighter-rouge">version-rule: latest</code>,表示匹配最新版本的服务提供者</li>
+    <li>版本范围:例如<code class="highlighter-rouge">1.0.0-2.0.2</code>,表示匹配版本号在1.0.0至2.0.2之间的服务提供者,包含1.0.0和2.0.2</li>
+  </ul>
+
+  <p>此配置项默认为<code class="highlighter-rouge">latest</code></p>
+</blockquote>
+
+<h3 id="手工配置服务契约">手工配置服务契约</h3>
+
+<p>服务消费者的开发者在线下拿到服务提供者的契约,配置到消费者工程的特定目录下。服务契约在项目中的存放目录与<a href="/cn/users/service-contract/">服务契约</a>的配置说明部分相同。</p>
+
+<p>microservice目录下的每一个目录代表一个微服务,微服务目录下的每一个yaml文件代表一个schema契约,文件名就是schemaId。applications目录下存放需要指明appId的服务契约,用于跨app调用等场景。目录结构如下所示:</p>
+<pre><code class="language-txt">resources
+  - microservices
+      - serviceName            # 微服务名
+          - schemaId.yaml      # schema接口的契约
+  - applications
+      - appId                  # 应用ID
+          - serviceName        # 微服务名
+              - schemaId.yaml  # schema接口的契约
+</code></pre>
+
+<h3 id="从服务中心自动下载契约">从服务中心自动下载契约</h3>
+
+<p>服务消费者也可以不用显式地将契约存放在项目目录中,当程序启动时,ServiceComb框架会自动根据microservice.yaml文件中配置的服务提供者的微服务名称和版本号,从服务中心自动下载契约信息。</p>
+
+        
+      </section>
+
+      <footer class="page__meta">
+        
+        
+
+
+        
+      </footer>
+
+      
+
+      
+
+    </div>
+
+    
+  </article>
+
+  
+  
+</div>
+
+
+    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
+    <div align="center" style="margin: 0 0;">
+    <ins class="adsbygoogle"
+         style="display:block; border-bottom: initial;"
+         data-ad-client="ca-pub-7328585512091257"
+         data-ad-slot="3049671934"
+         data-ad-format="auto"></ins>
+    </div>
+
+    <div class="page__footer">
+      <footer>
+        <!-- start custom footer snippets -->
+
+<!-- end custom footer snippets -->
+        <div class="container">
+  <div class="row justify-content-md-center">
+    
+    <div class="col">
+      <ul>
+        <p class="header">资源</p>
+        <li><a href="/cn/docs/quick-start/">快速入门</a></li>
+        <li><a href="/cn/users/user-guide/">用户指南</a></li>
+        <li><a href="/cn/slides/">资料</a></li>
+        <li><a href="/cn/users/faq/">常见问题</a></li>
+      </ul>
+    </div>
+    <div class="col">
+      <ul>
+        <p class="header">贡献</p>
+        <li><a href="https://github.com/ServiceComb/ServiceComb.github.io/issues/new?title=Issue with _users/cn/use-service-contract.md">报告本网页问题</a></li>
+        <li><a href="https://github.com/ServiceComb/ServiceComb.github.io/edit/master/_users/cn/use-service-contract.md">在Github上编辑此页</a></li>
+        <li><a href="/cn/developers/submit-codes/">代码提交指南</a></li>
+      </ul>
+    </div>
+    <div class="col">
+      <ul class="social-icons">
+        <p class="header">社区</p>
+        <li>
+            <a href="https://groups.google.com/forum/#!forum/servicecomb-developers" target="_blank"><span class="group">开发者</span></a> |
+            <a href="https://groups.google.com/forum/#!forum/servicecomb-users" target="_blank">用户</span></a>
+        </li>
+        <li>
+            <a href="http://github.com/ServiceComb" target="_blank"><span class="github">Github</span></a>
+        </li>
+        <li>
+            <a href="https://twitter.com/ServiceComb" target="_blank"><span class="twitter">Twitter</span></a>
+        </li>
+        <li>
+            <a href="/feed.xml" target="_blank"><span class="rss">Feed</span></a>
+        </li>
+      </ul>
+    </div>
+  </div>
+</div>
+<div class="page__footer-bottom">
+  <div>&copy; 2017 Apache incubator ServiceComb. 技术来自于 <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
+</div>
+
+      </footer>
+    </div>
+
+    <script src="/assets/js/main.min.js"></script>
+
+
+
+
+  <script>
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-101622733-1', 'auto');
+  ga('send', 'pageview');
+</script>
+
+
+
+
+
+
+
+  </body>
+</html>