|
17 | 17 | - [自定义RegionId](#自定义regionid) |
18 | 18 | - [自动化Endpoint寻址](#自动化endpoint寻址) |
19 | 19 | - [Endpoint默认寻址逻辑](#endpoint默认寻址) |
| 20 | + - [Endpoint标准寻址](#endpoint标准寻址) |
20 | 21 | - [HTTP连接池配置](#http连接池配置) |
21 | 22 | - [HTTPS请求配置](#https请求配置) |
22 | 23 | - [指定Scheme](#指定scheme) |
@@ -254,7 +255,7 @@ public class SampleCode { |
254 | 255 | > 默认支持自动寻址,无需手动指定Endpoint |
255 | 256 |
|
256 | 257 | 为了简化用户配置,Vocoengine 提供了灵活的 Endpoint 自动寻址机制。用户无需手动指定服务地址,SDK 会根据服务名称、区域(Region)等信息自动拼接出合理的访问地址,并支持用户自定义DualStack(双栈)支持。 |
257 | | -### Endpoint默认寻址 |
| 258 | +### Endpoint默认寻址 |
258 | 259 | **Endpoint默认寻址逻辑** |
259 | 260 | 1. 是否自动寻址Region |
260 | 261 | 内置自动寻址Region列表代码:[./volcengine-java-sdk-core/src/main/java/com/volcengine/endpoint/DefaultEndpointProvider.java#BOOTSTRAP_REGION](./volcengine-java-sdk-core/src/main/java/com/volcengine/endpoint/DefaultEndpointProvider.java#L25) |
@@ -294,6 +295,39 @@ public class SampleCode { |
294 | 295 | } |
295 | 296 | ``` |
296 | 297 |
|
| 298 | +### Endpoint标准寻址 |
| 299 | +**标准寻址规则** |
| 300 | + |
| 301 | +| Global服务 | 双栈 | 格式 | |
| 302 | +|----------|----|------------------------------------------------------------------------------------------------------------------| |
| 303 | +| 是 | 是 | `{Service}.volcengine-api.com` | |
| 304 | +| 是 | 否 | `{Service}.volcengineapi.com` | |
| 305 | +| 否 | 是 | `{Service}.{region}.volcengine-api.com`| |
| 306 | +| 否 | 否 | `{Service}.{region}.volcengineapi.com` | |
| 307 | +**代码示例:** |
| 308 | + |
| 309 | +是否global服务根据具体调用的服务决定的,是否global无法修改的。 |
| 310 | +可以参考列表:[./volcengine-java-sdk-core/src/main/java/com/volcengine/endpoint/StandardEndpointProvider.java#SERVICE_INFOS](./volcengine-java-sdk-core/src/main/java/com/volcengine/endpoint/StandardEndpointProvider.java#L142) |
| 311 | +```java |
| 312 | +import com.volcengine.ApiClient; |
| 313 | +import com.volcengine.sign.Credentials; |
| 314 | +import java.util.HashSet; |
| 315 | +import com.volcengine.endpoint.StandardEndpointProvider; |
| 316 | + |
| 317 | +public class SampleCode { |
| 318 | + public static void main(String[] args) { |
| 319 | + String regionId = "cn-beijing"; |
| 320 | + ApiClient apiClient = new ApiClient() |
| 321 | + .setCredentials(Credentials.getEnvCredentials()) |
| 322 | + .setEndpointResolver(new StandardEndpointProvider()) // 设置标准寻址 |
| 323 | + .setRegion(regionId) // 设置region |
| 324 | + .setUseDualStack(true); // 设置是否双栈 |
| 325 | + } |
| 326 | +} |
| 327 | +``` |
| 328 | + |
| 329 | + |
| 330 | + |
297 | 331 | # Http连接池配置 |
298 | 332 |
|
299 | 333 | > **默认** |
|
0 commit comments