Skip to content

Configurable prefix for Redis keys #195

@rooks

Description

@rooks

I would like to be able to specify global prefix for all Redis keys. It can be used in case of multiple app instances using one Redis instance. This is basically our strategy for testing environments.

It seems that RedisStorageOptions is the right place to put this option. Configuration could look like this:

app.UseHangfire(config =>
{
    config.UseRedisStorage("localhost", 0, new RedisStorageOptions
    {
        Prefix = "QA1"
    });
})

I've dug though code and found that most of the code using RedisStorage.Prefix straight away. There is also static RedisStorage.GetRedisKey(string key) which could be used for encapsulating prefix management. Is this a viable option? Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions