Redis Source
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Stable"
Get Events from a Redis cache.
Configuration Options
The following table summarizes the configuration options available for the redis-source
Kamelet:
Property | Name | Description | Type | Default | Example |
---|---|---|---|---|---|
Channels | Required Redis Channels. | string | one | ||
Redis Host | Required The host where Redis server is running. | string | |||
Redis Port | Required The port where Redis server is running. | integer | |||
Command | Redis Command. | string | SUBSCRIBE | ||
Serializer | RedisSerializer fully qualified name implementation. | string | org.springframework.data.redis.serializer.StringRedisSerializer |
Dependencies
At runtime, the redis-source
Kamelet relies upon the presence of the following dependencies:
-
camel:kamelet
-
camel:core
-
camel:spring-redis
Camel JBang usage
Prerequisites
-
You’ve installed JBang.
-
You have executed the following command:
jbang app install camel@apache/camel
Supposing you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:redis-source"
parameters:
.
.
.
steps:
- to:
uri: "kamelet:log-sink"
You can now run it directly through the following command
camel run route.yaml
Redis Source Kamelet Description
Authentication
This Kamelet supports Redis authentication using password-based authentication. The connection can be configured with or without authentication depending on your Redis setup.
Configuration
The Redis Source Kamelet supports the following configurations:
-
Redis Host: The hostname or IP address of the Redis server (required)
-
Redis Port: The port number of the Redis server (default: 6379)
-
Password: Password for Redis authentication (optional)
-
Channels: Redis channels to subscribe to (required)
-
Connection Timeout: Connection timeout in milliseconds
-
Database: Redis database number to connect to
Output Format
The Kamelet outputs Redis messages received from subscribed channels. Messages include both the channel name and message content.
Usage Example
- route:
from:
uri: "kamelet:redis-source"
parameters:
redisHost: "redis.example.com"
redisPort: "6379"
password: "redispass"
channels: "notifications,alerts"
steps:
- to:
uri: "kamelet:log-sink"
Example with Multiple Channels
- route:
from:
uri: "kamelet:redis-source"
parameters:
redisHost: "redis.example.com"
redisPort: "6379"
channels: "user-events,system-events,admin-events"
steps:
- to:
uri: "kamelet:log-sink"