doc-exports/docs/dis/umn/dis_06_0015.html
Xiong, Chen Xiao 1a4b9e91b7 DIS UMN test2 version
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>
2022-11-14 16:38:55 +00:00

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();