Skip to content

EMQX Webhook Action Not Sending Data

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about EMQX Webhook Action Not Sending Data. We cover key concepts, practical examples, and best practices.

The Problem

Rule engine webhook action fails to POST data to an HTTP endpoint.

Quick Fix

Wrong

POST http://localhost:8080/webhook  # Endpoint not reachable
Webhook request fails — connection refused or timeout.
# 1. Create webhook action
curl -u admin:public -X POST http://localhost:18083/api/v5/actions \
  -H 'Content-Type: application/json' \
  -d '{
    'name': 'webhook_action',
    'type': 'webhook',
    'parameters': {
      'url': 'http://my-server:8080/webhook',
      'headers': {'X-API-Key': 'secret'},
      'method': 'POST'
    }
  }'

# 2. Attach to rule
curl -u admin:public -X POST http://localhost:18083/api/v5/rules/my_rule/actions \
  -d '{'id': 'webhook_action'}'

# 3. Test
mqttx pub -t test -m '{'msg':'hello'}'
# Check server logs for POST receipt
HTTP 200 from webhook endpoint. Rule metrics show success.

Prevention

Ensure the webhook endpoint is reachable from the EMQX broker. Set reasonable timeout (default 5s). Use HTTPS for sensitive data. Webhook body contains the full message (topic, payload, metadata). Handle 2xx as success. Headers can include auth tokens.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### What data does the webhook receive?

JSON with topic, payload (base64 for binary), clientid, qos, timestamp, and publish properties.

Does the webhook retry on failure?

EMQX will retry based on the action retry configuration. Default retry count is 3 with exponential backoff.

Can I use dynamic URLs?

Yes. The URL can be a template with variables: http://my-server/webhook/${topic}. Evaluated at runtime.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro