blob: 59e5254baa87e24058a06234feeae00cd7198317 [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="../question_answer/">
<link rel="next" href="../interface-compatibility/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-9.5.19">
<title>FAQ - 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">
</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">
FAQ
</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--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
<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="false">
<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="../../general-development/visit-sc/" class="md-nav__link">
<span class="md-ellipsis">
Access Service Center
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/metrics/" class="md-nav__link">
<span class="md-ellipsis">
Metrics
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/microservice-invocation-chain/" class="md-nav__link">
<span class="md-ellipsis">
Microservice invocation chain
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/customized-tracing/" class="md-nav__link">
<span class="md-ellipsis">
Customized-Tracing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/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="../../general-development/http-filter/" class="md-nav__link">
<span class="md-ellipsis">
Http Filter
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/file-upload/" class="md-nav__link">
<span class="md-ellipsis">
File Uploading
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/file-download/" class="md-nav__link">
<span class="md-ellipsis">
File Downloading
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/reactive/" class="md-nav__link">
<span class="md-ellipsis">
Reactive Programing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/dnsconfig/" class="md-nav__link">
<span class="md-ellipsis">
DNS Custom Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/dai-li-she-zhi/" class="md-nav__link">
<span class="md-ellipsis">
Proxy Settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/report-framework-version/" class="md-nav__link">
<span class="md-ellipsis">
Report framework version
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/cross-app-invocation/" class="md-nav__link">
<span class="md-ellipsis">
Cross-application invocation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/secret-field/" class="md-nav__link">
<span class="md-ellipsis">
Customized serialization and deserialization
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/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="../../general-development/produceprocess/" class="md-nav__link">
<span class="md-ellipsis">
Return value serialization extension
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/CORS/" class="md-nav__link">
<span class="md-ellipsis">
CORS mechanism
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/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="../../general-development/shutdown/" class="md-nav__link">
<span class="md-ellipsis">
Shutdown gracefully
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/error-handling/" class="md-nav__link">
<span class="md-ellipsis">
Handling exceptions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/multienvironment/" class="md-nav__link">
<span class="md-ellipsis">
Multi-environment isolation between microservice instances
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../general-development/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--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_13" checked>
<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="true">
<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_answer/" class="md-nav__link">
<span class="md-ellipsis">
Q & A
</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">
FAQ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../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>FAQ</h1>
<ol>
<li>**Q: What is the relationship between ServiceComb and SpringCloud, and what is ServiceComb specific application scenarios? **</li>
</ol>
<p>A: ServiceComb is a set of microservice development frameworks based on large-scale IT system practices. It encapsulates a set of microservices running models based on best practices in development. These capabilities are completely transparent to users,it can be integrated and adjusted by configuration. In the operation and maintenance phase, microservices operation and maintenance have been fully considered, providing rich monitoring indicators and dynamic governance capabilities.
    B: ServiceComb's capabilities can be used as a separate development framework, in a scenario that requires a lightweight microservice solution, or on SpringCloud, working with other components provided by SpringCloud, in heavyweight The scene together with SpringCloud produces a '1+1&gt;2' effect.</p>
<ol>
<li>
<p>**Q: Do we have a problem with IntelliJ's free version? **
    A: No problem, use IntelliJ development, refer to [Setup Developer Environment] (/cn/developers/setup-develop-environment/) for the corresponding environment configuration.</p>
</li>
<li>
<p><strong>Q: What need to be cautious when using Java-Chassis?</strong></p>
</li>
</ol>
<p>A: There are a few restrictions when using Java-Chassis:
* Before version 0.3.0-SNAPSHOT, it does not support annotations like <code>@GetMapping</code>.
* When using the same HTTP request method, e.g. GET, the method name need to be unique as it will become operation ID when swagger generates contracts.
* Class and method name need to be public.</p>
<ol>
<li>**Q: Contract generation will report error: 'Caused by: java.lang.Error: OperationId must be unique', does not support function overriding? **</li>
</ol>
<p>A: We support function overriding, plus the <code>@ApiOperation</code> tag. There are examples in demo-pojo. Each interface must have a unique operation id.</p>
<ol>
<li><strong>Q: When using the <em>spring-boot-starter-provider</em> dependency, property like <code>spring.main.web-environment</code> not working in <em>application.yml</em> file.</strong></li>
</ol>
<p>A: When you need both the starter provider dependency and the servlet, you need to declare <code>spring.main.web-environment</code> in <em>application.properties</em> file or declare it in <em>application.yml</em> file and create an empty <em>application.properties</em> file.</p>
<ol>
<li><strong>Q: What's the dependency differences between gateway and other microservices?</strong></li>
</ol>
<p><code>xml
&lt;groupId&gt;org.apache.servicecomb&lt;/groupId&gt;
&lt;artifactId&gt;spring-boot-starter-provider&lt;/artifactId&gt;</code></p>
<p>A: Gateway depends on not only the <code>spring-boot-starter-provider</code>, but also the <code>spring-boot-starter-discovery</code>. This can refer to the <em>manger</em> implementation of <a href="https://github.com/ServiceComb/LinuxCon-Beijing-WorkShop">LinuxCon-Beijing-Workshop</a>.</p>
<ol>
<li><strong>Q: Do gateway need to configure assembly like the other microservices? Is <em>/maven/gateway</em> the default path of the docker maven plugin?</strong></li>
</ol>
<p>A: Yes. Docker maven plugin relies on the assembly files to generate docker image. <em>/maven</em> is the default path of docker maven plugin and <em>/gateway</em> is the path defined in the assembly file.</p>
<ol>
<li><strong>Q: Are there any restrictions of the return type of our API? Should it be the type of ResponseEntity?</strong></li>
</ol>
<p>A: No, examples can refer to <a href="https://github.com/apache/incubator-servicecomb-java-chassis/blob/master/integration-tests/springmvc-tests/src/test/java/org/apache/servicecomb/demo/springmvc/tests/SpringMvcIntegrationTestBase.java">the implementation of integration-test</a> in java-chassis.</p>
<ol>
<li>**Q: After the microservice is started, the interface cannot be called correctly, or is there no error returned? **</li>
</ol>
<p>A: Please check that the calling path is exactly the same as the path published in the Producer implementation code. The boot log on the Producer side can see the output of the map path, for example:
   
    <code>[INFO] Swagger mapped "{[/hello/], method=[GET], produces=[application/json]}"</code>
   
    For different programming styles (models) to implement Producer documentation and notes, please see: <a href="/cn/users/develop-with-jax-rs/">Jaxrs</a> <a href="/cn/users/develop-with-springmvc/">SpringMVC</a> <a href="/cn/users/develop-with-transparent-rpc/">Pojo</a> <a href="/cn/users/develop-with-spring-boot-starter/">Spring Boot</a> .
   
10. **Q: The port number under the microservice.yaml configuration file has been modified via eclipse. After starting the program, the port number does not work? **</p>
<p>A: You need to import the sample project alone. If you import the entire ServiceComb-Java-Chassis project, the IDE will not compile the sample because the sample directory is not in the ServiceComb-Java-Chassis module. There is no error message under eclipse. Prompt message. Therefore, eclipse starts the demo of the sample and will find that the modified port does not work.
   
12. ** Q: How do I customize the HTTP status code in the REST interface for a Java method? **</p>
<p>A: For normal return values, you can do this with SwaggerAnnotation, for example:</p>
<p><code>java
@ApiResponse(code = 300, response = String.class, message = "")
public int test(int x) {
return 100;
}</code></p>
<p>For the return value of the exception, you can do this by throwing a custom InvocationException, for example:</p>
<p>```java
public String testException(int code) {
String strCode = String.valueOf(code);
switch (code) {
case 200:
return strCode;
case 456:
throw new InvocationException(code, strCode, strCode + " error");
case 556:
throw new InvocationException(code, strCode, Arrays.asList(strCode + " error"));
case 557:
throw new InvocationException(code, strCode, Arrays.asList(Arrays.asList(strCode + " error")));
default:
break;
}</p>
<pre><code> return "not expected";
</code></pre>
<p>}
```</p>
<ol>
<li><strong>Q: How to customize the log configuration of your own microservice?</strong></li>
</ol>
<p>A: ServiceComb does not bind the logger, just uses slf4j, users can freely choose log4j/log4j2/logback and so on. ServiceComb provides a log4j extension that supports incremental configuration of log4j's properties files on a standard log4j basis.
    * By default, the configuration file is loaded by the rule: "classpath*:config/log4j.properties"
    * Actually search all the <code>config/log4j.properties and config/log4j.*.properties</code> in the classpath, and cut out the <code>\*</code> from the searched file to perform alpha. Sort, then load in order, and the final synthesized file is used as the log4j configuration file.
    * If you want to use ServiceComb's log4j extension, you need to call Log4jUtils.init, otherwise it will be used according to the rules of the standard logger.</p>
<ol>
<li>**Q: When the service is configured with multiple transports, how do you choose which transport to use at runtime? **</li>
</ol>
<p>A:
   * ServiceComb's consumer, transport, handler, and producer are decoupled, and each function works together through contract definitions, namely:
      Consumer use transparent rpc, or springmvc development and use of highway, or RESTful transmission on the network does not matter with the producer is to use transparent rpc, or jaxrs, or springmvc development, there is no relationship between the receiver is not perceived, business development methods and transmission methods</p>
<p>* Consumer access to the producer, at the runtime's transport selection, the general rule is:
      The consumer's transport and the producer's endpoint take the intersection. If there are multiple transports after the intersection, they are used in turn.</p>
<p>Decomposed, there are the following scenarios:</p>
<p>* When a microservice producer opens both the highway and the RESTful endpoint
      * Only the highway transport jar is deployed in the consumer process, only the producer's highway endpoint is accessed.
      * Only the RESTful transport jar is deployed in the consumer process, only the RESTful endpoint of the producer is accessed.
      * In the consumer process, both the highway and RESTful transport jars are deployed, and the producer's highway and RESTful endpoints are accessed in turn.</p>
<p>If, at this time, the consumer wants to use a transport to access the producer, it can be configured in the microservice.yaml of the consumer process, specifying the name of the transport:</p>
<p><code>yaml
      Servicecomb:
        References:
          &lt;service_name&gt;:
            Transport: highway</code></p>
<p>* When a microservice producer only opens the endpoint of the highway
      * The consumer process only deploys the highway transport jar, then the highway access is normally used.
      *The consumer process only deploys RESTful transport jars and cannot be accessed
      * The consumer process deploys both the highway and the RESTful transport jar, and the highway access is normally used.</p>
<p>* When a microservice producer only opens RESTful endpoints
      *The consumer process only deploys the highway transport jar and cannot access it.
      * The consumer process only deploys RESTful transport jars, which normally uses RESTful access.
      * The consumer process deploys both the highway and the RESTful transport jar, and the RESTful access is normally used.</p>
<ol>
<li><strong>Q: The swagger body parameter type is incorrectly defined, causing the content registered in the service center to have no type information</strong></li>
</ol>
<p><strong>Symptom:</strong></p>
<p>Define the following interface, put the parameters into the body to pass</p>
<p><code>yaml
/testInherate:
Post:
operationId: "testInherate"
Parameters:
- in: "body"
Name: "xxxxx"
Required: false
Type: string
Responses:
200:
Description: "response of 200"
Schema:
$ref: "#/definitions/ResponseImpl"</code></p>
<p>Define the interface in the above way. After the service is registered, the interface type: string that is queried from the service center is lost and becomes:</p>
<p><code>yaml
/testInherate:
Post:
operationId: "testInherate"
Parameters:
- in: "body"
Name: "xxxxx"
Required: false
Responses:
200:
Description: "response of 200"
Schema:
$ref: "#/definitions/ResponseImpl"</code></p>
<p>If the client does not place a swagger, the following exception is also reported:</p>
<p><code>text
Caused by: java.lang.ClassFormatError: Method "testInherate" in class ? has illegal signature "</code></p>
<p>A: When defining the type of the body parameter, you need to use the schema. You cannot use type directly.</p>
<p><code>yaml
/testInherate:
Post:
operationId: "testInherate"
Parameters:
- in: "body"
Name: "request"
Required: false
Schema:
Type: string
Responses:
200:
Description: "response of 200"
Schema:
$ref: "#/definitions/ResponseImpl"</code></p>
<ol>
<li><strong>Q: Does the ServiceComb microservices framework service innovate via long connection?</strong></li>
</ol>
<p>A: http request via a long connection (with a timeout), and the highway mode also via a long connection (all the time).</p>
<ol>
<li><strong>Q: Is the service disconnected service center registration information automatically deleted?</strong></li>
</ol>
<p>A: The service center heartbeat detects that the service instance is unavailable, only the service instance information is removed, and the static data of the service is not removed.</p>
<ol>
<li><strong>Q: How to implement service registration if you use the tomcat method to integrate the ServiceComb microservices framework</strong></li>
</ol>
<p>A: If you use the ServiceComb sdk servlet method (using the transport-rest-servlet dependency) to deploy to the tomcat as a war package, you need to ensure that the rest port configuration in the service description file (microservice.yaml) is consistent with the external container to implement the service. Register correctly. Otherwise, the tomcat open port cannot be perceived.</p>
<ol>
<li><strong>Q: If you use the tomcat method to integrate the ServiceComb microservices framework, how to register the context of the war package deployment to the service center when the service is registered</strong></li>
</ol>
<p>A: When publishing the service interface, you need to put the context of the war package deployment at the front of the baseurl, so that the path registered to the service center is the complete path (including the context). Example:</p>
<p><code>java
    @path(/{context}/xxx)
    Class ServiceA</code></p>
<ol>
<li><strong>Q: How does the ServiceComb microservices framework implement data transparent transmission between multiple microservices</strong></li>
</ol>
<p>A:
    Transmitting data into:</p>
<p><code>java
    CseHttpEntity&lt;xxxx.class&gt; httpEntity = new CseHttpEntity&lt;&gt;(xxx);
    / / Transparent content
    httpEntity.addContext("contextKey","contextValue");
    ResponseEntity&lt;String&gt; responseEntity = RestTemplateBuilder.create().exchange("cse://springmvc/springmvchello/sayhello",HttpMethod.POST, httpEntity, String.class);</code></p>
<p>Transparent data acquisition:</p>
<p><code>java
    @Override
    @RequestMapping(path="/sayhello",method = RequestMethod.POST)
    Public String sayHello(@RequestBody Person person, InvocationContext context){
      / / Transparent data acquisition
      context.getContext();
      Return "Hello person " + person.getName();
    }</code>
   </p>
<ol>
<li><strong>Q: How does the ServiceComb microservices framework service customize the return status code?</strong></li>
</ol>
<p>A:
    <code>java
    @Override
    @RequestMapping(path = "/sayhello",method = RequestMethod.POST)
    Public String sayHello(@RequestBody Person person){
      InvocationContext context = ContextUtils.getInvocationContext();
      / / Custom status code
      context.setStatus(Status.CREATED);
      Return "Hello person "+person.getName();
    }</code></p>
<ol>
<li><strong>Q: Partial exposure of ServiceComb body Model</strong></li>
</ol>
<p>A: There may be some attributes in the body object corresponding to an interface. You don't want to open it. Do not bring it out when generating the schema. Use:</p>
<p><code>java
    @ApiModelProperty(hidden = true)</code></p>
<ol>
<li><strong>Q: ServiceComb framework gets the address of the remote consumer</strong></li>
</ol>
<p>A: If you use the http rest method (using the transport-rest-vertx dependency) you can get it in the following way:</p>
<p><code>java
    AbstractProducerContextArgMapper httpRequestCreator = (AbstractProducerContextArgMapper)invocation.getHandlerContext().get(RestConst.HTTP_REQUEST_CREATOR);
    If(httpRequestCreator != null){
      HttpServletRequest req = (HttpServletRequest)httpRequestCreator.createContextArg(invocation);
      System.out.println(req.getRemoteHost());
    }</code></p>
<p>The actual scenario is to take the outermost address, so LB should be passed to edgeservice, and edgeService should be passed outside the context.</p>
<ol>
<li><strong>Q: ServiceComb describes the handler</strong></li>
</ol>
<p>A: The consumer default handler is simpleLB. When there is no configuration, the handler chain will use this. If the handler is configured, it must contain the lb handler. Otherwise, the call error is reported in the document.</p>
<ol>
<li><strong>Q: ServiceComb log replacement</strong></li>
</ol>
<p>A: CSE java-chassis log recommendation method is to use Log4jUtils.init() at startup, directly use the recommended Log4j for log management, but some scenarios do not want to use log4j, such as want to use log4j2 or logback, below log4j2 Take a brief introduction to the next step:</p>
<p>1. Do not use Log4jUtils.init() in the code;
   2. Remove the log4j configuration file (it doesn't matter if you don't delete it, because it won't be used);
   3. Exclude the log4j introduced by the CSE framework, for example:
      <code>xml
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.servicecomb&lt;/groupId&gt;
          &lt;artifactId&gt;provider-springmvc&lt;/artifactId&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;log4j&lt;/groupId&gt;
                  &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;</code>
   4. Introducing the dependency of log4j2</p>
<p><code>xml
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-slf4j-impl&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
      &lt;/dependency&gt;</code></p>
<p>If there is no version dependency management, you need to fill in the version number.</p>
<p>5. Add the log4j2 configuration file log4j2.xml. Please check the official description for this, for example:</p>
<p><code>xml
       &lt;?xml version="1.0" encoding="UTF-8"?&gt;
       &lt;!--Log level and priority ordering: OFF &gt; FATAL &gt; ERROR &gt; WARN &gt; INFO &gt; DEBUG &gt; TRACE &gt; ALL --&gt;
       &lt;!--Configuration behind the configuration, this is used to set the internal information output of log4j2, can not be set, when set to trace, you will see various detailed output inside log4j2 --&gt;
       &lt;!--monitorInterval: Log4j can automatically detect the modified configuration file and reconfigure itself, set the interval seconds --&gt;
       &lt;configuration status="WARN" monitorInterval="30"&gt;
           &lt;!--First define all appender--&gt;
           &lt;appenders&gt;
           &lt;!--This output console configuration --&gt;
               &lt;console name="Console" target="SYSTEM_OUT"&gt;
               &lt;!--Format of output log --&gt;
                   &lt;PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/&gt;
               &lt;/console&gt;
               &lt;!--The file will print out all the information, this log will be automatically cleared every time the program is run, determined by the append attribute, this is also very useful, suitable for temporary testing --&gt;
               &lt;File name="log" fileName="log/test.log" append="false"&gt;
                  &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/&gt;
               &lt;/File&gt;
               &lt;!-- This will print out all info and the following level information. Each time the size exceeds the size, the size of the log will be automatically saved under the folder created by the year-month and compressed, as an archive --&gt;
               &lt;RollingFile name="RollingFileInfo" fileName="${sys:user.home}/logs/info.log"
                            filePattern="${sys:user.home}/logs/$${date:yyyy-MM}/info-%d{yyyy-MM-dd}-%i.log"&gt;
                   &lt;!--The console only outputs level and above information (onMatch), other direct rejection (onMismatch) --&gt;
                   &lt;ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/&gt;
                   &lt;PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/&gt;
                   &lt;Policies&gt;
                       &lt;TimeBasedTriggeringPolicy/&gt;
                       &lt;SizeBasedTriggeringPolicy size="100 MB"/&gt;
                   &lt;/Policies&gt;
               &lt;/RollingFile&gt;
               &lt;RollingFile name="RollingFileWarn" fileName="${sys:user.home}/logs/warn.log"
                            filePattern="${sys:user.home}/logs/$${date:yyyy-MM}/warn-%d{yyyy-MM-dd}-%i.log"&gt;
                   &lt;ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/&gt;
                   &lt;PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/&gt;
                   &lt;Policies&gt;
                       &lt;TimeBasedTriggeringPolicy/&gt;
                       &lt;SizeBasedTriggeringPolicy size="100 MB"/&gt;
                   &lt;/Policies&gt;
                   &lt;!-- DefaultRolloverStrategy property is not set, the default is up to 7 files in the same folder, here set 20 --&gt;
                   &lt;DefaultRolloverStrategy max="20"/&gt;
               &lt;/RollingFile&gt;
               &lt;RollingFile name="RollingFileError" fileName="${sys:user.home}/logs/error.log"
                            filePattern="${sys:user.home}/logs/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log"&gt;
                   &lt;ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/&gt;
                   &lt;PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%p] - %l - %m%n"/&gt;
                   &lt;Policies&gt;
                       &lt;TimeBasedTriggeringPolicy/&gt;
                       &lt;SizeBasedTriggeringPolicy size="100 MB"/&gt;
                   &lt;/Policies&gt;
               &lt;/RollingFile&gt;
           &lt;/appenders&gt;
           &lt;!-- Then define the logger, the appender will only take effect if the appender is defined and imported -&gt;
           &lt;loggers&gt;
               &lt;!--Filter out some useless DEBUG information from spring and mybatis --&gt;
               &lt;logger name="org.springframework" level="INFO"&gt;&lt;/logger&gt;
               &lt;logger name="org.mybatis" level="INFO"&gt;&lt;/logger&gt;
               &lt;root level="all"&gt;
                   &lt;appender-ref ref="Console"/&gt;
                   &lt;appender-ref ref="RollingFileInfo"/&gt;
                   &lt;appender-ref ref="RollingFileWarn"/&gt;
                   &lt;appender-ref ref="RollingFileError"/&gt;
               &lt;/root&gt;
           &lt;/loggers&gt;
       &lt;/configuration&gt;</code>
6. Start the service for verification</p>
<ol>
<li><strong>Q: Service timeout setting</strong></li>
</ol>
<p>A: Add the following configuration to the microservice description file (microservice.yaml):
   
<code>yaml
servicecomb:
request:
timeout: 30000</code></p>
<ol>
<li>**Q: The URL address can be uniquely located. Why do you want to add a schema? **</li>
</ol>
<p>A:
    1. The schema is used to match the service contract. It is used to ensure that the server and the consumer contract are compatible. Each contract needs a unique ID and is stored in the service center.
    2. Schema maps to the interface concept of java. When the consumer uses the transparent rpc mode to develop, it can find which operation in the micro service. The method names between schemas are not unique.
    3. operation qualified name is the key of the governance, and the URL cannot be directly searched because of the existence of the path parameter, and the qualified name will not change. Governance does not distinguish between transmissions. If governance goes by URL, then when highway is called in, it has to construct the url according to the parameters, and then the regular expression matches, which is too tossing.
    4. http is just a transport channel, and there are other transport channels that do not need to be mapped to URLs.</p>
<ol>
<li>**Q: When the Rest client is invocating, it only takes the service name and URL, and does not need to specify the schema id. In fact, according to this URL, the specific contract can also be found. So what is the role of the specified schema id? **</li>
</ol>
<p>A: Since transparent rpc is an interface call and does not have a URL, the internal is actually normalized to the operation to describe, so that it can be uniquely mapped to the specific request processing in conjunction with the schema id.
    </p>
<ol>
<li>**Q: What is the concept of Transport? What is it used for? **</li>
</ol>
<p>A: The Transport is responsible for codec, and transmission. The communication model has two kinds of Rest and Highway. The Highway corresponds to the private protocol, which uses protobuf encoding, and the Rest uses json. Highway and Rest are based on vertx, and vertx is based on netty.</p>
<ol>
<li>**Q: Is there be multiple appIDs and microservices in a service provider? What scenario will this happen? **</li>
</ol>
<p>A: Yes, what is expressed here is a concept of merge. The microservice.yaml file, which may exist in both jars, disks, and command line arguments, specifies that they are merged by priority and are used for added flexibility. In the jar is the default value, in addition to the environment variables, command line parameters, configuration center coverage, providing multiple layers of customization.</p>
<ul>
<li><strong>Q: How does ServiceComb interact with the service center?</strong></li>
</ul>
<p>A: Take the rest, mainly responsible for registration, taking data and heartbeat, etc.; 'watch event' via websocket, watch event is to observe whether the service center instance information has changed.</p>
<ul>
<li>**Q: Is there a governance center like dubbo? **</li>
</ul>
<p>A: bizkeeper is a handler, one of the contents of governance. Governance can be extended by handlers.</p>
<ul>
<li>**Q: How to understand the service path? **</li>
</ul>
<p>A: Each microservice has a servicePathManager, and each schema registers its own path.</p>
<ul>
<li>**Q: Can the browser directly access the microservice Endpoint? **</li>
</ul>
<p>A: Yes, the restful microservice Endpoint can be used to access the service that provides the get method directly in the browser using HTTP plus service path. If it is to access the services provided by other Http methods, it is recommended to install and use.(https://www.sap.com/developer/tutorials/api-tools-postman-install.html)</p>
<ul>
<li>**Q: When the contract is generated, do you have to add the version number and language? **</li>
</ul>
<p>A: The contract belongs to the microservice. The microservice has a version, but the language should not be accompanied by the version number. Contractual requirements should be independent of language. The contract "no version", the version of the contract is embodied in the microservice, the instance can find the version of the microservice to which it belongs, and a certain contract can be found.</p>
<ul>
<li>**Q: The design code in ServiceRegistry is similar to Eureka? **</li>
</ul>
<p>A: Our first version was built on the basis of Spring Cloud. Later, when we found that it was not enough to use it, we gradually made our own set, so it was designed after fully referring to Eureka.</p>
<ul>
<li>**Q: Some rpc is netty calling redis implementation, what is the advantage over direct netty forwarding? **</li>
</ul>
<p>A: Maybe I want to use Redis to solve the subscription release. But this is not a big deal. I tried it before, but later I changed it to ServiceComb.
    </p>
<ul>
<li>**Q: If you introduce the <code>transport-rest-servlet</code> and <code>transport-rest-vertx</code> dependencies at the same time, how does it decide which one to use? **</li>
</ul>
<p>A: If the port is not occupied, use vertx; if it is occupied, use servlet.</p>
<ul>
<li>**Q: What is the scenario for qps flow control design? **</li>
</ul>
<p>A: Rate limit has two main functions. First, it guarantees the service effect to some key services by restricting different consumers, and the second is to prevent the avalanche effect. The thickness of the water pipe can be determined according to the importance of the service. ServiceComb supports two types of current limiting methods, namely, consumer-side current limiting and server-side current limiting. The consumer-side current limiting can achieve relatively fine control.</p>
<ul>
<li>**Q: If the server is a chain call, that is, a-&gt;b-&gt;c, then does the QPS flow control cause flow pipe uneven and unbalanced? **</li>
</ul>
<p>A: The general mode is to measure and then set. The qps settings are ultimately tuned in conjunction with the overall business needs, rather than setting them up on a single node.</p>
<ul>
<li><strong>Q: The service failed to be invoked via cse://serviceName/appPath, error: java.lang.Error:not support def type:class io.swagger.models.properties xxx</strong></li>
</ul>
<p>A: Check whether the version of java-chassis that the consumer and provider depend on are consistent. If they are inconsistent, please modify and use the newer version.</p>
<ul>
<li><strong>Q: When sending a rest request, the following error is reported: Bad Request, description: http:request body too large</strong></li>
</ul>
<p>A: Check if the Service Center is older version, and if so, upgrade to the latest version.</p>
<ul>
<li>**Q: How to ignore the attributes specified in the contract DTO? **</li>
</ul>
<p>A: If you are using 'rest transport', because it is Json serialization, you can use @JsonIgnore annotations to mark attributes that need to be ignored; 'highway transport' is not currently supported. Note that you need to update the version of the microservice after the modification, for example:</p>
<p><code>java
public class OutputForTest{
@JsonIgnore
private String outputId = null;
private String inputId = null;
...
}</code></p>
<ul>
<li><strong>Q: How to get the value of a field in the header in a user-defined handler</strong>
    A: Use the @ApiImplicitParams annotation declaration in the user-defined handler and the invocation.getArgs() to get the value of the header. E.g:
<code>java
public class MyHandler implements Handler {
@ApiImplicitParams({@ApiImplicitParam(name = "tester", dataType = "string", paramType = "header")})
@Override
public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception {
Object[] args = invocation.getArgs();
System.out.println(args);
}
}</code></li>
<li>**Q: The exception is thrown when the microservices runtime: <code>java.lang.Error:not support def type:calss io.swagger.models.properties BaseIntegerProperty</code>? **</li>
</ul>
<p>A: Service Center can be upgraded to version 4.0.0+ to solve [Service Center latest version portal] (http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center /1.0.0-m1/).</p>
<p><em>. </em><em>Q: Our API can not be accessed after microservices are up. It just returns </em>404 Not Found<em>. The codes we use is as follows:</em>*</p>
<p><code>java
@RestController
@RestSchema(schemaId = "worker")
public class WorkerController {
@RequestMapping(value="/count", method=RequestMethod.GET)
public int getWorkerNumbers() {
...
}
}</code></p>
<p>A: Without specifying the base path, ServiceComb will use the classname as the base path. Hence, the path should be <code>/WorkerController/count</code> in the previous code. If you want to access path like <code>/count</code>, you need to specify base path as <code>/</code> as follows:
<code>java
@RequestMapping(value = "/")
public class WorkerController {}</code></p>
<p><em>. </em><em>Q: What\'s the default base path if I have not declared the value of RequestMapping annotation?</em>*</p>
<p>A: Supposed the class name of your controller is <em>HelloController</em>, the base path is /HelloController.</p>
</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>