forked from docs/doc-exports
Reviewed-by: Kovács, Zoltán <zkovacs@t-systems.com> Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com> Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
19 lines
3.2 KiB
HTML
19 lines
3.2 KiB
HTML
<a name="asm_bestpractice_3004"></a><a name="asm_bestpractice_3004"></a>
|
|
|
|
<h1 class="topictitle1">PASSTHROUGH Solution</h1>
|
|
<div id="body1568601267887"><div class="section" id="asm_bestpractice_3004__section31341036202718"><h4 class="sectiontitle">Introduction</h4><p id="asm_bestpractice_3004__p113281537152719">When the client in the SDK calls the target service by an interface, the client accesses the service name, instead of the service instance.</p>
|
|
<p id="asm_bestpractice_3004__p1558213370273"><span><img class="eddx" id="asm_bestpractice_3004__image3665173692010" src="en-us_image_0000001181766534.png"></span></p>
|
|
</div>
|
|
<div class="section" id="asm_bestpractice_3004__section142081854182714"><h4 class="sectiontitle">Description</h4><p id="asm_bestpractice_3004__p952312555275">Cases are different based on the Dubbo protocol versions:</p>
|
|
<ul id="asm_bestpractice_3004__ul0462214112111"><li id="asm_bestpractice_3004__li194621614122116">2.7.4 and later versions: Cloud Native 2.7.4 and later versions have reconstructed the service discovery model which is consistent with that of Kubernetes. Service information can be directly obtained via interfaces.</li><li id="asm_bestpractice_3004__li646034722212">2.7.3 and earlier versions: The Dubbo community versions do not provide the level-2 relationship between interfaces and services. The SDK needs to maintain the mapping from interfaces to services based on the actual usage mode. For example, information such as a service name may be provided in extended information during service registration.</li></ul>
|
|
<p id="asm_bestpractice_3004__p118134052818">You can select a processing mode based on your SDK. The SDK of an earlier version can perform the following operations in the existing service registration and discovery processes:</p>
|
|
<ol id="asm_bestpractice_3004__ol575422915251"><li id="asm_bestpractice_3004__li1175432914256">Extend the definition of <strong id="asm_bestpractice_3004__b1518364252719">Service</strong> in the registration information. During service deployment, service metadata can be injected into the SDK as environment variables, including <strong id="asm_bestpractice_3004__b1767912538289">appname</strong> and <strong id="asm_bestpractice_3004__b280315546281">namespace</strong>, which indicate the name and namespace of the deployed service, respectively.</li><li id="asm_bestpractice_3004__li153893585258">When the service is started, the relationship between the Dubbo interface and Kubernetes service name and namespace is registered in the Registry.</li><li id="asm_bestpractice_3004__li1320631142612">When a client initiates an access request, the service metadata is queried by the interface according to the original service discovery process, and the corresponding service information is used to assemble an RPC request. The extended field <strong id="asm_bestpractice_3004__b98596335188">Attachment</strong> is advised to be used to store the <strong id="asm_bestpractice_3004__b9194138143016">appname</strong> and <strong id="asm_bestpractice_3004__b14152201083015">namespace</strong> information in the Dubbo request.</li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="asm_bestpractice_3003.html">SDK Adaptation Mode</a></div>
|
|
</div>
|
|
</div>
|
|
|