forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com> Co-committed-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com>
2.8 KiB
2.8 KiB
Initializing a DIS Client
You can use either of the following methods to initialize a DIS SDK client instance: For details about endpoint, ak, sk, region, and projectId, see Obtaining Authentication Information.
- Use the code to initialize the DIS SDK client instance. For details about the code example, see the ProducerDemo.java file.
//Create a DIS client instance. DIS dic = DISClientBuilder.standard() .withEndpoint("https://ip:port") .withAk("xxxx") .withSk("xxxx") .withProjectId("xxxxxxx") .withRegion("xxxx") .build();
- Use the configuration file to initialize a DIS SDK client instance.
Add the following configuration items to the dis.propertites file in the dis-sdk-demo\resources directory:
- ak/sk: AK/SK created on the IAM
- region: region of the stream
- endpoint: access address of the DIS
- projectId: project ID of the stream
//Create a DIS client instance. DIS dic = DISClientBuilder.standard().build();
Parent topic: DIS SDK Usage Guide