Quick Start with Docker
This document describes how to run rekuiper in Docker. It also describes how to deploy your first real-time streaming rule.
1. Start rekuiper
Start rekuiper with all standard network ports exposed:
docker run -d \
--name rekuiper \
-p 9081:9081 \
-p 20498:20498 \
-p 20499:20499 \
indusstack/rekuiper:1.0.0-rc4Verify that the engine operates and responds:
curl http://localhost:9081/pingExpected response:
pong2. Create a Data Stream
A Stream defines the incoming data schema and the protocol source. Create an in-memory stream named demo:
curl -X POST http://localhost:9081/streams \
-H "Content-Type: application/json" \
-d '{
"sql": "CREATE STREAM demo (temperature float, humidity bigint) WITH (DATASOURCE=\"demo\", FORMAT=\"JSON\")"
}'Expected response:
Stream demo is created.3. Deploy a Streaming Rule
A Rule defines continuous SQL logic. The rule processes incoming events and sends results to target actions (sinks).
Create a rule named rule_high_temp. This rule triggers when temperature is greater than 30.0°C and writes results to the engine log:
curl -X POST http://localhost:9081/rules \
-H "Content-Type: application/json" \
-d '{
"id": "rule_high_temp",
"sql": "SELECT temperature, humidity FROM demo WHERE temperature > 30.0",
"actions": [
{
"log": {}
}
]
}'Expected response:
Rule rule_high_temp was created4. Send Test Telemetry
Send test sensor readings through the rekuiper HTTP push endpoint:
# 1. Send an event below the threshold (temperature = 22.0) - The engine filters this out
curl -X POST http://localhost:9081/streams/demo/data \
-H "Content-Type: application/json" \
-d '{"temperature": 22.0, "humidity": 45}'
# 2. Send an event above the threshold (temperature = 34.8) - The engine triggers the rule
curl -X POST http://localhost:9081/streams/demo/data \
-H "Content-Type: application/json" \
-d '{"temperature": 34.8, "humidity": 55}'5. Verify the Execution
Check the real-time metrics of the rule:
curl http://localhost:9081/rules/rule_high_temp/statusOutput:
{
"source_demo_0_records_in_total": 2,
"source_demo_0_records_out_total": 2,
"op_filter_0_records_in_total": 2,
"op_filter_0_records_out_total": 1,
"op_project_0_records_in_total": 1,
"op_project_0_records_out_total": 1,
"sink_log_0_records_in_total": 1,
"sink_log_0_records_out_total": 1
}Interpretation of metrics:
source_demo_0_records_in_total:2(the stream received two events).op_filter_0_records_out_total:1(the filter rejected the lower temperature and accepted the higher temperature).sink_log_0_records_out_total:1(the sink recorded the alert).
Read the container logs to view the output:
docker logs rekuiper | grep "LOG SINK"6. Web Console and API Documentation
rekuiper includes an embedded web console and an interactive OpenAPI 3.0 interface.
- Embedded Web Console: Open
http://localhost:9081/uito monitor live throughput, active rules, and Dead-Letter Queue (DLQ) errors. - Interactive OpenAPI Explorer: Open
http://localhost:9081/api-docs(or loadhttp://localhost:9081/openapi.json) to test REST endpoints and validate SQL rules.
For a complete walkthrough with screenshots, see Management with the Interactive OpenAPI / Swagger UI.
Next Steps
- Read Core Architecture and Design.
- Read about Windowing Functions (Tumbling, Hopping, Sliding, Session).
- Configure Production Deployments.
- Connect external MQTT Brokers.