Git Product home page Git Product logo

Comments (4)

OS-ramamurtisubramanian avatar OS-ramamurtisubramanian commented on June 28, 2024 1

@mrniko ,

It seems like the issue is at

https://github.com/redisson/redisson/blob/master/redisson/src/main/java/org/redisson/cluster/ClusterConnectionManager.java#L98

When the Redisson is initialized in multiple JVMs, few of the pods fail to detect whether Sharding is supported and end up subscribing to RedissonTopic instead of RedissonShardedTopic.

I Implmented the RedissonClient interface and copied the required code from Redisson class and I forcefully set the sharding support as true in the SubscribeService and After that it's working as expected.

from redisson.

mrniko avatar mrniko commented on June 28, 2024

Unable to reproduce. Below is the code example:

            for (int i = 0; i < 10; i++) {
                int j = i;
                RedissonClient rr = Redisson.create(r.getConfig());
                RMapCache<String, String> tt2 = rr.getMapCache("test");
                tt2.addListener(new EntryExpiredListener<String, String>() {

                    @Override
                    public void onExpired(EntryEvent<String, String> event) {
                        System.out.println("expired" + j + " " + event);
                    }
                });
            }

            RMapCache<String, String> tt = r.getMapCache("test");
            tt.addListener(new EntryExpiredListener<String, String>() {

                @Override
                public void onExpired(EntryEvent<String, String> event) {
                    System.out.println("expired " + event);
                }
            });
            tt.put("1", "2", 1, TimeUnit.SECONDS);

            Thread.sleep(10000);

log output:

expired3 org.redisson.api.map.event.EntryEvent@5c4f5ebb
expired4 org.redisson.api.map.event.EntryEvent@7fc2d768
expired7 org.redisson.api.map.event.EntryEvent@57a189ce
expired8 org.redisson.api.map.event.EntryEvent@647f1cab
expired org.redisson.api.map.event.EntryEvent@43753d30
expired5 org.redisson.api.map.event.EntryEvent@307fe2b2
expired6 org.redisson.api.map.event.EntryEvent@5cff5f93
expired9 org.redisson.api.map.event.EntryEvent@de62147
expired1 org.redisson.api.map.event.EntryEvent@5c4f783a
expired2 org.redisson.api.map.event.EntryEvent@1777296f
expired0 org.redisson.api.map.event.EntryEvent@7940476c

from redisson.

OS-ramamurtisubramanian avatar OS-ramamurtisubramanian commented on June 28, 2024

@mrniko
I noticed one more thing, With 4 pods I get the following results on redis-cli

PUBSUB SHARDNUMSUB redisson_map_cache_expired:{cacheName} results in 1
PUBSUB NUMSUB redisson_map_cache_expired:{cacheName} results in 3

from redisson.

mrniko avatar mrniko commented on June 28, 2024

Thanks for providing more details. Slave nodes reply with MOVED error. Fixed now.

from redisson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.