// Enter the key obtained from TencentCloud API here
context.setSecretId("AKIDfdsfdsfsdt1331431sdfds"); Enter the `secretID` obtained from TencentCloud API
context.setSecretKey("test111usdfsdfsddsfRkeT"); Enter
the `secretKey` obtained from TencentCloud API
// Enter the IP and port obtained through data subscription in the DTS service here
context.setServiceIp("10.66.112.181"); Enter the IP obtained from the data subscription configuration
context.setServicePort(7507);
Enter the port obtained from the data subscription configuration
final DefaultSubscribeClient client = new DefaultSubscribeClient(context);
// Enter the names of both the database and table to sync and modify the name of the file where they will be stored
final String targetDatabase = "test"; Enter the name of the database to subscribe to
final String targetTable = "alantest"; Enter the name of the table to subscribe to
final String fileName = "test.alan.txt"; Enter the name of the local file for storage
client.addClusterListener(listener);
// Enter the `dts-channel` configuration information obtained from the data subscription configuration here
client.askForGUID("dts-channel-e4FQxtYV3It4test"); Enter the DTS channel name obtained from the data subscription
client.start();
Was this page helpful?