This tutorial shows how to integrate Upstash Kafka with EMQX Cloud
EMQX, a robust open-source MQTT message broker, is engineered for scalable, distributed environments, prioritizing high availability, throughput, and minimal latency. As a preferred protocol in the IoT landscape, MQTT (Message Queuing Telemetry Transport) excels in enabling devices to effectively publish and subscribe to messages.Offered by EMQ, EMQX Cloud is a comprehensively managed MQTT service in the cloud, inherently scalable and secure. Its design is particularly advantageous for IoT applications, providing dependable MQTT messaging services.This guide elaborates on streaming MQTT data to Upstash by establishing data integration. This process allows clients to route temperature and humidity metrics to EMQX Cloud using MQTT protocol, and subsequently channel these data streams into a Kafka topic within Upstash.
In the EMQX Cloud console, under your deployment, go to Data Integrations and select Upstash for Kafka.
Fill in the Endpoints details from the Upstash Cluster details into the Kafka Server fields. Insert the username and password created in Create Credentials into the respective fields and click Test to confirm the connection.
Opt for New to add a Kafka resource. You’ll see your newly created Upstash for Kafka listed under Configured Resources.
Formulate a new SQL rule. Input the following SQL command in the SQL field. This rule will process messages from the temp_hum/emqx topic and append details like client_id, topic, and timestamp.
Copy
Ask AI
SELECTtimestamp as up_timestamp,clientid as client_id,payload.temp as temp,payload.hum as humFROM"temp_hum/emqx"
Conduct an SQL test by inputting the test payload, topic, and client data. Success is indicated by results similar to the example below.
Advance to Next to append an action to the rule. Specify the Kafka topic and message format, then confirm.