No. A channel can only be connected to and used by one SDK for consumption at a time. If you have multiple downstream SDKs to subscribe to the same table, please create multiple channels.
Yes. An SDK can consume multiple channels at a time.
A channel can only be connected to by one SDK for consumption. If another connection is created, this error will occur. In this case, you need to check whether the application has exited. If the error persists, you can set the restart interval a little longer, such as 20 seconds.
The incremental data that can be subscribed to through data subscription includes all INSERT/DELETE/UPDATE changes (DML) and structure changes (DDL).
Yes. Data subscription only covers data changes, and it does not matter if the indices are different. However, if you have subscribed to structure changes and your TencentDB instance involves index changes, local consumption of structure changes may fail if the indices are different.
When this error occurs, relevant prompts will be displayed on the screen. Generally, it is because that the downstream SDK connected to the subscription channel is still consuming data. You can go to the DTS Console to view the consumption source IP and check whether the downstream SDK is consuming data, and if yes, you need to stop the consumption first before you can modify the consumption time point.
When data is written to a channel (or not all data is consumed), the consumption time point in the console can be migrated normally if data consumption is normal.
If there is any message not acknowledged, the SDK will keep pulling it until its cache is full. At this time, the consumption time point saved on the server will be the time point of the last message before it is acknowledged.
When the SDK is restarted, the server will push data again from the consumption time point of the unacknowledged message to avoid message loss. Therefore, the SDK will receive some duplicate messages.
The data in the data subscription channel will be retained for 1 day and then deleted. If the time point of the last consumed data entry before the SDK exits is -1 day ago, then the data at the consumption time point cannot be subscribed to successfully. To fix this problem, you need to modify the consumption time point to ensure it is within the valid range.
This is probably because the ackAsConsumed API is not called to report the consumption time point in the SDK code. In this case, the data in the limited cache space of the SDK will not be deleted. When the cache is full, new data cannot be pulled, so the SDK will crash and fail to subscribe to any data.
Note:
All messages here, including BEGIN and COMMIT messages and those irrelevant to the business logic, must be acknowledged for consumption.
No. Based on the user-specified consumption time point or the time point of the last acknowledged consumption, the server will search for the start point of the complete transaction corresponding to this consumption time point. Data is sent to the downstream SDK from the beginning of the transaction. Therefore, the full data of the complete transaction can be received.
No. In case of master/slave switchover or master restart, data subscription will automatically perform switch imperceptibly to the SDK.
You need to verify whether the input parameters are correct, including ip
, port
, secretId
, secretKey
, and channelId
.
secretId
has no permission when the SDK is started?A sub-account has no permission by default. It must be granted access to the name/dts:AuthenticateSubscribeSDK
operation or all DTS operations through the QcloudDTSFullAccess
policy by the root account.
Note:
You need to create the
QcloudDTSFullAccess
policy on your own as it is not predefined in CAM.
{
"version": "2.0",
"statement": [
{
"action": [
"dts:AuthenticateSubscribeSDK"
],
"resource": "*",
"effect": "allow"
}
]
}
{
"version": "2.0",
"statement": [
{
"action": [
"dts:AuthenticateSubscribeSDK"
],
"resource": "qcs::dts:::channel/{channelId}",
"effect": "allow"
}
]
}
No, if data consumption is normal. However, there is a very slim chance that if the SDK quits abnormally and the last acknowledged consumption time point is not reported promptly, duplicate data may be received when the SDK is started next time.
If a complete transaction is not acknowledged, the data will be pulled again from the beginning of the transaction when the SDK is started again. In this case, the data cannot be regarded as duplicate data. The core logic of the SDK will ensure the transaction integrity.
No. A data subscription instance can only subscribe to one TencentDB instance.
You are recommended to use a host with higher specification. When a single SDK runs smoothly at a high speed, it consumes less than 1 core of CPU and less than 1.5 GB of memory.
Was this page helpful?