Redis Bridge Component
The Redis Bridge component extends the Bus across multiple nodes.
Data published to subscribed topics on a node's Bus can be exported to a Redis server. The same component can be used to import from Redis topics to a Bus. Thus Bus data in one Xrt instance may be reflected in the Bus of another instance, or data may be exchanged with other Redis-based applications.
Redis Bridge Configuration
The following tables describe the configuration variables to use with the Redis bridge component:
Redis Bridge Configuration Variables
Parameter | Type | Description | Valid Values | Required Y/N |
---|---|---|---|---|
Bus | String | The name of the Bus component to use | The name of an existing Bus component | Y |
Logger | String | The name of the Logger component to use | The name of an existing Logger component | N |
QueueSize | Unsigned Integer | The size of the queue for the bus subscriber to hold messages | Default: 4 | N |
Cookie | Integer | The cookie value for the subscriber | A valid cookie | N |
RetryCount | Unsigned Integer | Maximum number of times to retry reconnection | Default: 5 | N |
RetryInterval | Unsigned Integer | Interval in seconds to attempt reconnection | Default: 1 | N |
Patterns | Array of Strings | Array of patterns to match on the Bus component to publish to Redis | Pattern, or patterns, to match on the bus | Y |
RedisPatterns | Array of Strings | Array of patterns to match for Redis subscription | Pattern, or patterns, to match from Redis | N |
RedisConfig | Object | The Redis configuration to use | See Redis Configuration Variables | Y |
Redis Configuration Variables
The following table describes the Redis configuration variables:
Parameter | Type | Description | Valid Values | Required |
---|---|---|---|---|
ServerAddress | String | Address of the Redis server to connect | Address of the Redis server, which is running | Y |
Port | Unsigned Integer | Port number of the Redis server | Port number, defaults to 6379 | N |
Username | String | The username to use in authentication and authorization | A valid username, defaults to default |
N |
Password | String | The password to use in authentication and authorization | A valid password for the specified username | N |
Redis Bridge Configuration Example
The following example configures a Redis Bridge component to publish data to Redis on the topics defined in Patterns and subscribes to the topic(s) defined in RedisPatterns to publish data to the bus.
"Patterns": [ "xrt/devices/test/data" ],
"RedisPatterns": ["xrt/devices/bridge/*"],
"RedisConfig":
{
"ServerAddress": "127.0.0.1",
"Port":6379,
"Username":"default",
"Password":"foobared"
}