Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RedisClientMasterSlaves #295

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

alexmihailov
Copy link
Contributor

In many cases, there is a need to write data to the master, and read from one of the slave nodes. The rediscala library supports such functionality using class redis.RedisClientMasterSlaves. I implemented support for RedisClientMasterSlaves by specifying the configuration source: master-slaves. Example:

play.cache.redis {
    source: master-slaves

    # username to your redis hosts (optional)
    username: some-username
    # password to your redis hosts, use if not specified for a specific node (optional)
    password: "my-password"
    # number of your redis database, use if not specified for a specific node (optional)
    database: 1 
    
    # master node
    master: {
        host: "localhost"
        port: 6380
        # number of your redis database on master (optional)
        database: 1
        # username on master host (optional)
        username: some-username
        # password on master host (optional)
        password: something
    }
    # slave nodes
    slaves: [
        {
            host: "localhost"
            port: 6381
            # number of your redis database on slave (optional)
            database: 1
            # username on slave host (optional)
            username: some-username
            # password on slave host (optional)
            password: something
        }
    ]
}

Copy link
Owner

@KarelCemus KarelCemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thank you for your contribution, nice PR. I have just one small note, if you could fix it, then I'd merge it and release it.

@alexmihailov alexmihailov force-pushed the feature/master-slave branch from fc9474f to cd6a1ca Compare April 8, 2024 06:59
@alexmihailov alexmihailov force-pushed the feature/master-slave branch from cd6a1ca to 30de987 Compare April 8, 2024 20:26
@KarelCemus KarelCemus merged commit dd8c5e9 into KarelCemus:master Apr 11, 2024
2 checks passed
@KarelCemus
Copy link
Owner

Releasing as 4.1.0, thank you for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants