Why can't my AMQP client receive real-time messages?
This topic describes common issues and solutions for when an AMQP client cannot receive messages from a server-side subscription that is configured in IoT Platform.
Why can't my online consumer client receive messages after I configure an AMQP server-side subscription?
Problem description
After an AMQP server-side subscription is configured, the corresponding online AMQP client for the consumer group does not receive messages.
Possible causes
The message type for the current device communication is not included in the AMQP server-side subscription.
Real-time message pushes are throttled. Messages that exceed the limit cannot be consumed in real time. IoT Platform retries the push.
A single connection to an AMQP client is limited to 1,000 TPS. The message forwarding TPS limit is determined by the specifications of your purchased instance.
Slow message consumption prevents messages from being consumed in real time, which causes them to be added to the stacked message queue.
After the consumer client's consumption capacity stabilizes, IoT Platform retries pushing the stacked messages.
If the client fails to consume the retried messages, the stacked message queue might become blocked. IoT Platform retries the push to the client at intervals of about one minute.
Solution
In the IoT Platform console, for the target instance, go to the page. Confirm that a Push Message Type has been added to the product subscription.
For more information, see Configure an AMQP server-side subscription.
On the server-side subscription page, go to the Consumer Group Details page to view the real-time message consumption rate.
Increase the message consumption rate based on the server-side subscription limits. You can scale out by increasing the number of AMQP client connections, starting more AMQP clients, or upgrading the message forwarding TPS specification for the instance.
In the AMQP software development kit (SDK) provided by IoT Platform, you can configure the number of connections using connectionCount. The maximum value is 128.
A consumer group can have up to 64 active AMQP consumer clients.
To upgrade an instance, see Upgrade an instance.
Why do message pushes fail for data reported by a device?
Problem description
The message type for the AMQP server-side subscription is Device Reported Message. However, data that a device reports from the Thing Specification Language (TSL) model is not pushed to the AMQP client.
Possible causes
The corresponding TSL model feature is not defined for the product.
The data format reported by the device does not comply with the Alink protocol standard data format. The message cannot be pushed to the AMQP client of the consumer group.
The TSL model feature identifier in the data reported by the device does not match the defined feature identifier.
Solution
In the IoT Platform console, for the target instance, go to the product page. On the Define Feature tab, check if a TSL model feature is defined.
If no TSL model feature is defined, add one as needed. For more information, see Add a TSL model.
If a TSL model feature is defined, make sure the feature identifier for the TSL model data is correct. Also, ensure the data format complies with the Alink protocol standard data format. Then, report the TSL model data again.
For information about the Alink protocol format, see Device properties, events, and services.
Why doesn't the business-side consumer client receive messages even when the device reports them successfully?
Problem description
After a device reports data, you can check the IoT Platform logs tab under in the IoT Platform console for the instance. You can confirm that the Device-to-Cloud Message was successful, but the Server-side Subscription Message push failed.
Possible causes
No active AMQP consumer client for the subscribed consumer group is connected to IoT Platform, or the connected AMQP client is offline.
The Validation Type for the product was set to No Validation during creation. As a result, data reported by the device is sent directly to IoT Platform without validation. If this data does not comply with the Alink protocol standard data format, it cannot be pushed to the AMQP client of the consumer group.
Solution
Connect an AMQP consumer client to IoT Platform for the consumer group that is associated with the AMQP server-side subscription. Ensure that the AMQP client remains online during runtime.
For possible reasons why an AMQP client goes offline, see Why does my AMQP client automatically go offline?. For instructions on how to connect an AMQP client, see Connect an AMQP client.
Ensure the data format reported by the device complies with the Alink protocol standard data format. Then, report the TSL model data again.
For information about the Alink protocol format, see Device properties, events, and services.
References
What is server-side subscription?: Learn about the application scenarios and benefits of AMQP server-side subscription.
Data types supported by TSL models: Learn about the data formats supported by device TSL models.
Validate TSL model data: Learn about the logic for validating device TSL model data.
Use a TSL model for device communication: Learn about the complete process of device communication using a TSL model.