Contact Us
Log In

Message Queue

Last Updated on : 2022-09-05 07:28:29download

Message Service is used to actively push the event data to external partners through Pulsar, which meets their demands for real-time and persistent messages.

Pulsar is a multi-tenant, high-performance solution for server-to-server messaging. Pulsar was originally developed by Yahoo and now is under the stewardship of the Apache Software Foundation. Tuya Smart Message Service is customized and modified based on Apache Pulsar. Message Service integration can be achieved with the Pulsar SDK provided by Tuya.
As a message broker, Pulsar is built on the Pub/Sub (publish and subscribe) pattern. In this pattern, producers publish messages to topics. Consumers subscribe to those topics, process incoming messages, and send an acknowledgment when processing is completed.
When a subscription is created, Pulsar retains all messages, even if the consumer is disconnected. Retained messages are discarded only when a consumer acknowledges that those messages are processed successfully.
Moreover, multiple consumers can subscribe to the same topic. After messages are processed, consumers need to send acknowledgments to brokers, so brokers can discard these messages. The Pulsar brokers provided by Tuya Smart allocate multiple partitions for each topic. Pulsar brokers send messages according to partitions and consumers.

Message development process

Message Queue

Message receiving process

Message Queue


  • Authentication security:
    Tuya Smart Pulsar Message Service adopts a highly customized authentication algorithm and dynamic tokens to enhance security. You can ignore the implementation details and accomplish the authentication based on the provided SDK.

  • Data security:
    Transmission security: Tuya Smart Pulsar Message Service transmits data based on the SSL.
    Business security: Business data is encrypted with AES-128 and requests are signed.