Redis Connector
Overview
Section titled “Overview”The Redis connector enables writing data to Redis, an in-memory data structure store commonly used for caching, message queuing, and real-time analytics.
Connector Types:
RedisWriter- Write data to Redis lists
Redis Writer
Section titled “Redis Writer”Push data to a Redis list:
{ "type": "RedisWriter", "config": { "endpoint": "localhost:6379", "key": "sensor_data" }}With Authentication
Section titled “With Authentication”{ "type": "RedisWriter", "config": { "endpoint": "redis.example.com:6379", "password": "your_redis_password", "database": 0, "key": "factory/sensors" }}Configuration Parameters
Section titled “Configuration Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
endpoint | string | ✅ | Redis server address (host:port) |
key | string | ✅ | Redis list key to push data to |
password | string | ❌ | Redis password for authentication |
database | integer | ❌ | Redis database number (default: 0) |
Data Format
Section titled “Data Format”Data is serialized as JSON and pushed to the specified Redis list using RPUSH:
{ "temperature": 25.5, "pressure": 101.3, "timestamp": 1234567890}Common Use Cases
Section titled “Common Use Cases”1. Real-Time Data Queue
Section titled “1. Real-Time Data Queue”Buffer sensor data for downstream processing:
{ "type": "RedisWriter", "config": { "endpoint": "localhost:6379", "key": "sensor_queue" }}2. Multi-Database Setup
Section titled “2. Multi-Database Setup”Write to a specific Redis database:
{ "type": "RedisWriter", "config": { "endpoint": "localhost:6379", "database": 2, "key": "production_data" }}3. Secure Remote Connection
Section titled “3. Secure Remote Connection”Connect to a password-protected Redis instance:
{ "type": "RedisWriter", "config": { "endpoint": "redis.mycompany.com:6379", "password": "secure_password", "key": "iot_events" }}Troubleshooting
Section titled “Troubleshooting”Connection Failed
Section titled “Connection Failed”Solutions:
- Verify endpoint address and port
- Check network connectivity and firewall rules
- Ensure Redis server is running
- Verify password if authentication is enabled
Write Failed
Section titled “Write Failed”Solutions:
- Check Redis memory limits
- Verify key name is valid
- Ensure database number exists
- Check Redis logs for errors
Best Practices
Section titled “Best Practices”- Use Meaningful Keys: Organize keys with namespaces (e.g.,
factory/line1/sensors) - Monitor List Size: Implement consumers to prevent unbounded list growth
- Use Appropriate Database: Separate different data types into different databases
- Secure Connections: Always use passwords in production environments