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

Near Caching for native client does not work #620

Closed
blancqua opened this issue Aug 1, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@blancqua
Copy link

commented Aug 1, 2013

Hello,

We are trying to use the new near caching functionality for native clients (Hazelcast version 2.6). However this does not work. According to me this is because of following reason:

com.hazelcast.client.MapClientProxy (line 53):
MapConfig mapConfig = config.getMapConfig(name);

-> Always returns "generic" Map config, because in the name of the map, you have the client prefix added:

com.hazelcast.client.HazelcastClient (line 163):
return (IMap<K, V>) getClientProxy(Prefix.MAP + name);

Therefore, near caching never works...

Or are we doing something wrong?

Kind Regards,
Wouter Blancquaert, Software Architect

@pveentjer

This comment has been minimized.

Copy link
Member

commented Aug 2, 2013

I see the bug, I'll make a fix.

@pveentjer

This comment has been minimized.

Copy link
Member

commented Aug 2, 2013

Will be resolved in Hazelcast 2.6.2. If you need it earlier, you need to build the snapshot. We are about to release 3.0, so the 2.6 branch will be quite stable, mostly bugfixes.

@mdogan mdogan closed this in #623 Aug 2, 2013

@blancqua

This comment has been minimized.

Copy link
Author

commented Aug 2, 2013

For now, we managed to work-around this issue by automatically generating mapconfigs using "c:" as prefix for each existing mapconfig. We'll upgrade to Hazelcast 2.6.2 once available.

public abstract class HazelcastMapConfigurer implements HazelcastConfigurer {

    private static final String CLIENT_PREFIX = "c:";

    @Override
    public void configure(Config config) {
        configure(config.getMapConfig(mapName()));
        configure(config.getMapConfig(CLIENT_PREFIX + mapName()));
    }

    abstract public String mapName();
    abstract public void configure(MapConfig mapConfig);

}

Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.