doc-exports/docs/dis/umn/dis_06_0015.html
Xiong, Chen Xiao 9d7af5e822 DIS UMN 20230116 version
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com>
Co-committed-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com>
2023-08-18 11:27:14 +00:00

2.8 KiB

Initializing a DIS Client

You can use one 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();