blob: 8e4942f46fec38edf332ca43f780e1963c332ee7 [file] [log] [blame]
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="prev" href="../error-handling/">
<link rel="next" href="../thread-model/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-9.5.19">
<title>Multi-environment isolation between microservice instances - ServiceComb Java Chassis Developers Guide</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.66ac8b77.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#multi-environment-isolation-between-microservice-instances" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="ServiceComb Java Chassis Developers Guide" class="md-header__button md-logo" aria-label="ServiceComb Java Chassis Developers Guide" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
ServiceComb Java Chassis Developers Guide
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Multi-environment isolation between microservice instances
</span>
</div>
</div>
</div>
<script>var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="ServiceComb Java Chassis Developers Guide" class="md-nav__button md-logo" aria-label="ServiceComb Java Chassis Developers Guide" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
</a>
ServiceComb Java Chassis Developers Guide
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
Getting Started
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Getting Started
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../start/terminology/" class="md-nav__link">
<span class="md-ellipsis">
Glossary
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../start/architecture/" class="md-nav__link">
<span class="md-ellipsis">
Architecture
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../start/development-environment/" class="md-nav__link">
<span class="md-ellipsis">
Development environment
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../start/first-sample/" class="md-nav__link">
<span class="md-ellipsis">
Develop the first microservice
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
<span class="md-ellipsis">
Development Service Provider
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Development Service Provider
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../build-provider/definition/service-definition/" class="md-nav__link">
<span class="md-ellipsis">
Service definition
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/define-contract/" class="md-nav__link">
<span class="md-ellipsis">
Service contract definition
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/code-first/" class="md-nav__link">
<span class="md-ellipsis">
Implicit API definition
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/swagger-annotation/" class="md-nav__link">
<span class="md-ellipsis">
Use Swagger annotations
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/springmvc/" class="md-nav__link">
<span class="md-ellipsis">
Develop with SpringMVC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/jaxrs/" class="md-nav__link">
<span class="md-ellipsis">
Develop with JAX-RS
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/transparent-rpc/" class="md-nav__link">
<span class="md-ellipsis">
Develop with Transparent RPC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/interface-constraints/" class="md-nav__link">
<span class="md-ellipsis">
Interface definition and data type
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/listen-address-and-publish-address/" class="md-nav__link">
<span class="md-ellipsis">
Service listening address and publishing address
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/thread-pool/" class="md-nav__link">
<span class="md-ellipsis">
Thread pool
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_11" >
<label class="md-nav__link" for="__nav_3_11" id="__nav_3_11_label" tabindex="0">
<span class="md-ellipsis">
Service Configuration
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_11_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_11">
<span class="md-nav__icon md-icon"></span>
Service Configuration
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../build-provider/configuration/ratelimite-strategy/" class="md-nav__link">
<span class="md-ellipsis">
Rate Limiting Policy
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/configuration/parameter-validator/" class="md-nav__link">
<span class="md-ellipsis">
Parameter Validator
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../build-provider/bootup/" class="md-nav__link">
<span class="md-ellipsis">
Boot-up Process
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-provider/access-log-configuration/" class="md-nav__link">
<span class="md-ellipsis">
Access Log Configuration
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
<span class="md-ellipsis">
Writing Service Consumer
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Writing Service Consumer
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../build-consumer/common-configuration/" class="md-nav__link">
<span class="md-ellipsis">
Consumer common configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/using-resttemplate/" class="md-nav__link">
<span class="md-ellipsis">
Using Rest Template
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/using-AsyncRestTemplate/" class="md-nav__link">
<span class="md-ellipsis">
Using AsyncRestTemplate
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/develop-consumer-using-rpc/" class="md-nav__link">
<span class="md-ellipsis">
Using with RPC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/with-contract/" class="md-nav__link">
<span class="md-ellipsis">
Contract
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_6" >
<label class="md-nav__link" for="__nav_4_6" id="__nav_4_6_label" tabindex="0">
<span class="md-ellipsis">
Invoke control
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4_6">
<span class="md-nav__icon md-icon"></span>
Invoke control
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../build-consumer/flow-control/" class="md-nav__link">
<span class="md-ellipsis">
Flow Control
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/fault-injection/" class="md-nav__link">
<span class="md-ellipsis">
Fault Injection
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../build-consumer/3rd-party-service-invoke/" class="md-nav__link">
<span class="md-ellipsis">
Invoke 3rd-party REST services
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-ellipsis">
Transports
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Transports
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../transports/rest-over-servlet/" class="md-nav__link">
<span class="md-ellipsis">
REST over Servlet
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../transports/rest-over-vertx/" class="md-nav__link">
<span class="md-ellipsis">
REST over Vertx
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../transports/highway-rpc/" class="md-nav__link">
<span class="md-ellipsis">
Highway
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../transports/http2/" class="md-nav__link">
<span class="md-ellipsis">
HTTP2
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" checked>
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
<span class="md-ellipsis">
General Development
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
General Development
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../visit-sc/" class="md-nav__link">
<span class="md-ellipsis">
Access Service Center
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../metrics/" class="md-nav__link">
<span class="md-ellipsis">
Metrics
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../microservice-invocation-chain/" class="md-nav__link">
<span class="md-ellipsis">
Microservice invocation chain
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../customized-tracing/" class="md-nav__link">
<span class="md-ellipsis">
Customized-Tracing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../local-develop-test/" class="md-nav__link">
<span class="md-ellipsis">
Local development and testing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../http-filter/" class="md-nav__link">
<span class="md-ellipsis">
Http Filter
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../file-upload/" class="md-nav__link">
<span class="md-ellipsis">
File Uploading
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../file-download/" class="md-nav__link">
<span class="md-ellipsis">
File Downloading
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../reactive/" class="md-nav__link">
<span class="md-ellipsis">
Reactive Programing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../dnsconfig/" class="md-nav__link">
<span class="md-ellipsis">
DNS Custom Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../dai-li-she-zhi/" class="md-nav__link">
<span class="md-ellipsis">
Proxy Settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../report-framework-version/" class="md-nav__link">
<span class="md-ellipsis">
Report framework version
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cross-app-invocation/" class="md-nav__link">
<span class="md-ellipsis">
Cross-application invocation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../secret-field/" class="md-nav__link">
<span class="md-ellipsis">
Customized serialization and deserialization
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../context/" class="md-nav__link">
<span class="md-ellipsis">
Using Context to pass control messages
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../produceprocess/" class="md-nav__link">
<span class="md-ellipsis">
Return value serialization extension
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../CORS/" class="md-nav__link">
<span class="md-ellipsis">
CORS mechanism
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../AlarmEvent/" class="md-nav__link">
<span class="md-ellipsis">
Get fuse and instance isolation alarm event information
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../shutdown/" class="md-nav__link">
<span class="md-ellipsis">
Shutdown gracefully
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../error-handling/" class="md-nav__link">
<span class="md-ellipsis">
Handling exceptions
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Multi-environment isolation between microservice instances
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../thread-model/" class="md-nav__link">
<span class="md-ellipsis">
Thread Model
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Configuration
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Configuration
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../config/general-config/" class="md-nav__link">
<span class="md-ellipsis">
General config
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../config/inject-config/" class="md-nav__link">
<span class="md-ellipsis">
Configuration injection
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Service Capability Open
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Service Capability Open
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../edge/open-service/" class="md-nav__link">
<span class="md-ellipsis">
Intruductions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../edge/by-servicecomb-sdk/" class="md-nav__link">
<span class="md-ellipsis">
Using Edge Service
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../edge/nginx/" class="md-nav__link">
<span class="md-ellipsis">
Using confd and Nginx as edge services
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../edge/zuul/" class="md-nav__link">
<span class="md-ellipsis">
Use zuul as edge services
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
<label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
<span class="md-ellipsis">
Service Packing and Running
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
Service Packing and Running
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../packaging/standalone/" class="md-nav__link">
<span class="md-ellipsis">
Standalone mode
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../packaging/web-container/" class="md-nav__link">
<span class="md-ellipsis">
WEB container mode
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
<label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
<span class="md-ellipsis">
Micro Service Security
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_10">
<span class="md-nav__icon md-icon"></span>
Micro Service Security
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../security/tls/" class="md-nav__link">
<span class="md-ellipsis">
Using TLS
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../security/rsa/" class="md-nav__link">
<span class="md-ellipsis">
Using RSA certification
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" >
<label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
<span class="md-ellipsis">
Using java chassis in Spring Boot
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_11">
<span class="md-nav__icon md-icon"></span>
Using java chassis in Spring Boot
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/using-java-chassis-in-spring-boot/" class="md-nav__link">
<span class="md-ellipsis">
Intruductions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/components-for-spring-boot/" class="md-nav__link">
<span class="md-ellipsis">
spring boot starter for java-chassis
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/java-application/" class="md-nav__link">
<span class="md-ellipsis">
JAVA application development
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/web-application/" class="md-nav__link">
<span class="md-ellipsis">
Web development method development
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/diff-between-java-web/" class="md-nav__link">
<span class="md-ellipsis">
The difference between JAVA application method and Web development method
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../using-java-chassis-in-spring-boot/diff-spring-mvc/" class="md-nav__link">
<span class="md-ellipsis">
The difference in Spring MVC mode
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_12" >
<label class="md-nav__link" for="__nav_12" id="__nav_12_label" tabindex="0">
<span class="md-ellipsis">
Handlers reference
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_12_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_12">
<span class="md-nav__icon md-icon"></span>
Handlers reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../references-handlers/intruduction/" class="md-nav__link">
<span class="md-ellipsis">
Intruductions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../references-handlers/loadbalance/" class="md-nav__link">
<span class="md-ellipsis">
Load Balancing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../references-handlers/publickey/" class="md-nav__link">
<span class="md-ellipsis">
Public key authentication
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_13" >
<label class="md-nav__link" for="__nav_13" id="__nav_13_label" tabindex="0">
<span class="md-ellipsis">
FAQ
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_13_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_13">
<span class="md-nav__icon md-icon"></span>
FAQ
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../question-and-answer/question_answer/" class="md-nav__link">
<span class="md-ellipsis">
Q & A
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../question-and-answer/faq/" class="md-nav__link">
<span class="md-ellipsis">
FAQ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../question-and-answer/interface-compatibility/" class="md-nav__link">
<span class="md-ellipsis">
Micro Service Interface Compatibility FAQ
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="multi-environment-isolation-between-microservice-instances">Multi-environment isolation between microservice instances</h1>
<p>When doing service discovery, developers need to understand that the microservice can discover instances of those other services. ServiceComb provides hierarchical instance isolation.</p>
<h1 id="microservices-instance-hierarchical-management">Microservices instance hierarchical management</h1>
<p>To understand the isolation level between instances, you first need to understand a well-established microservice system structure defined by ServiceComb:</p>
<p><img alt="" src="../../assets/isolation/architecture.png" /></p>
<p>In the microservice system structure, the top layer is the “project”, which is divided into multiple tenants under the project. The tenant contains multiple applications, and each application contains multiple environments, that is, the test and production environments can be separated. In a particular environment of a particular application, there are multiple microservices, and one microservice can have multiple versions at the same time. The above is the scope of all static metadata. A specific version of a particular service contains multiple microservice instances registered at runtime, because the information of the service instance is dynamic at runtime because of system scaling, failure, etc. The change, so the routing information of the service instance is again dynamic data. By hierarchically managing these data for microservices, this is natural to achieve logical isolation between instances.<br />
* Project corresponds to the project created under each region of Huawei cloud. Different projects are isolated from each other. If there is no new project under the region, it represents the region; for example, create a project named tianjing in North China (cn-north-1), if you want to register the microservice to the project, you can configure it in the microservice.yaml file:</p>
<pre><code class="language-yaml"> servicecomb:
credentials:
project: cn-north-1_tianjing
</code></pre>
<ul>
<li>
<p>Environment indicates the current environment of the microservice instance. You can configure the current instance environment through service_description.environment in the microservice.yaml file.</p>
</li>
<li>
<p>Application represents a logical entity of a software application, representing a computer software application that has a business function presented to the user. The application name can be configured in the microservice.yaml file via the APPLICATION_ID.</p>
</li>
<li>
<p>Service is a description of the functional objects that are accessed on demand. There are multiple services under one application, and each service calls each other. The service name can be specified in the microservice.yaml file by service_description.name.</p>
</li>
<li>
<p>Version indicates the current service version. There may be multiple versions under one service. The current microservice version can be configured in the microservice.yaml file through service_description.version. When the consumer accesses, the default access is based on the routing rule, which can set by servicecomb.references.[providerName].version-rule in consumer.</p>
</li>
</ul>
<h1 id="typical-scene">Typical scene</h1>
<h2 id="inter-application-isolation-and-cross-application-calls">Inter-application isolation and cross-application calls</h2>
<h3 id="function-introduction">Function introduction</h3>
<p>In the ServiceComb framework, an application contains multiple microservices.
The same microservice instance can be deployed as a public service to multiple applications by specifying a different APPLICATION_ID.</p>
<p><img alt="" src="../../assets/isolation/app.png" /></p>
<p>Different microservice instances, by default, are only allowed to call each other in the same application. When users need to call microservices between different applications, they need to enable cross-application calling. </p>
<h3 id="configuration-instructions">Configuration instructions:</h3>
<ol>
<li>To enable cross-application calls, you first need to enable cross-application call configuration in the microservice.yaml file on the provider side. The configuration items are as follows:</li>
</ol>
<pre><code class="language-yaml"> service_description:
properties:
allowCrossApp: true
</code></pre>
<ol>
<li>When the Consumer side specifies the microservice name to call the provider, it needs to add the application ID to which the provider belongs. The format changes from [microserviceName] to [appID]:[microserviceName].</li>
</ol>
<h3 id="code-example">Code example:</h3>
<p>Assume that the application to which the consumer belongs is helloApp, the application to which the provider belongs is hellApp2, and the name of the microservice is helloProvider.<br />
* RestTemplate call mode<br />
When the consumer side develops the microservice consumer in the RestTemplate mode, you need to change [microserviceName] to [appID]:[microserviceName] in the called URL, as follows:</p>
<pre><code class="language-java">RestTemplate restTemplate = RestTemplateBuilder.create();
ResponseEntity&lt;String&gt; responseEntity = restTemplate.getForEntity(“cse://helloApp2:helloProvider/hello/sayHello?name={name}”, String.class, “ServiceComb”);
</code></pre>
<ul>
<li>RPC call mode<br />
When the consumer side develops a microservice consumer in RPC mode, the declared service provider proxy is as follows:</li>
</ul>
<pre><code class="language-java">@RpcReference(schemaId = “hello”, microserviceName = “helloApp2:helloProvider”)
private Hello hello;
</code></pre>
<p>Cross-application calls are the same as calling microservices under the same application:</p>
<pre><code class="language-java">hello.sayHello(“ServiceComb”);
</code></pre>
<h1 id="typical-scene_1">Typical scene</h1>
<h2 id="development-environment-is-isolated-and-rapidly-developed">Development environment is isolated and rapidly developed</h2>
<h3 id="function-introduction_1">Function introduction</h3>
<p>By setting the environment, the ServiceComb framework can mark microservice instances as development, testing, acceptance, and production environments, and achieve natural isolation at the instance level. When the client looks for a server instance, it can only find server instance under the same environment.</p>
<p><img alt="" src="../../assets/isolation/environment.png" /></p>
<p>ServiceComb is strictly dependent on the contract when designing, so under normal circumstances, the contract has changed, you must modify the version of the microservice. However, if current is still development mode, then modify the interface is a very normal situation, when the modification is completed and the current service is started again, the newly generated contract and the old contract saved on the Service Center will conflict and report an error, causing the startup to fail, It is obviously unfriendly to developers by modifying the microservice version number or by deleting the cached data of the service on the Service Center each time.<br />
The ServiceComb framework supports rapid debugging of microservices in the development state by configuring the environment as development. When the interface is modified (the schema has changed), restart can be registered to the service center without modifying the version number.<br />
But if a consumer has already called the service before the restart, then the consumer side needs to be restarted to get the schema of the latest provider; for example, A-&gt;B, the B interface has been modified and restarted, then A is still using B's previous schema, The call may be in error. to avoid an unknown exception and A needs to be restarted. </p>
<h3 id="configuration-instructions_1">Configuration instructions:</h3>
<p>Only the following enumerated values are supported: development, testing, acceptance, production. If not configured, the default value is "" (empty).<br />
<em> Method 1: Set by the JVM startup parameter -Dservice_description.environment=development (enumeration value);<br />
</em> Method 2: Specify by microservice.yaml configuration file:</p>
<pre><code class="language-yaml"> service_description:
environment: development
</code></pre>
<ul>
<li>Method 3: Specify by environment variable SERVICECOMB_ENV (only for windows system), if it is development state, its value is configured as development;</li>
</ul>
<h1 id="typical-scene_2">Typical scene</h1>
<h2 id="three-centers-in-two-places">Three centers in two places</h2>
<h3 id="function-introduction_2">Function introduction</h3>
<p>In the scenario of deploying services across regions in a three centers in two places solution, the same services exists in multiple availableZones. It is necessary to implement the application in the same AZ with priority. If there is a problem with the same AZ, it must be able to access another AZ. To ensure the reliability of the service.<br />
ServiceComb provides data center configuration to partition and manage microservices. The data center contains three attributes: servicecomb.datacenter.name, servicecomb.datacenter.region, servicecomb.datacenter.availableZone, data center information does not provide isolation capabilities, and microservices can discover instances of other data centers. However, you can prioritize sending messages to a specified zone or zone by enabling instance affinity.</p>
<p><img alt="" src="../../assets/isolation/datacenter.png" /></p>
<p>When the client is routing, the request will be forwarded to the instance with the same zone/region, and then the instance with the same region but different zones. When they are all different, select one according to the routing rules. Affinity is not logical isolation. As long as the network between the instances is interconnected, it is possible to access it; if the network is unreachable, the access will fail.<br />
When the cloud is deployed on the Huawei cloud, the values of the region and the availableZone can be associated with the Huawei cloud region (for example, cn-north-1) and the available region. However, because the different regions on the Huawei cloud do not communicate with each other, the network is not interconnected, so it does not support cross-region access; in addition to the region value corresponding to Huawei cloud, you can also define other values by yourself, and adjust accordingly according to the actual situation, which is very flexible. </p>
<h3 id="configuration-instructions_2">Configuration instructions:</h3>
<pre><code class="language-yaml">servicecomb:
datacenter:
name: mydatacenter
region: my-Region
availableZone: my-Zone
</code></pre>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": [], "search": "../../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.dd8806f2.min.js"></script>
</body>
</html>