Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

How do I check if the value is already present in Redis through RMap via Redisson client?

$
0
0

I am new to Redisson and having an issue with the basic operation.I am trying to see if a value under a particular key in a Hashmap is already present in the underlying Redis store and return it.I must be doing something wrong with the Redisson API.

Here is what I am doing:

    public Optional<Double> getMetricEntryValue(String metricKey, String metricDataEntryKey) {        RMap<String, Double> metricDataMap = redissonClient.getMap(metricKey, MapOptions.defaults());        metricDataMap.loadAll(ImmutableSet.of(metricDataEntryKey), true, 1);        return Optional.ofNullable(metricDataMap.get(metricDataEntryKey));    }

Here is an error that I am getting:

2021-07-14 12:09:14,943 [,,,] ERROR [redisson-3-1] RedissonMap$4 - Unable to load value by key 2021-07-14:CO:12 for map fts-alert:partner-submitted-appsjava.lang.NullPointerException: null    at org.redisson.RedissonMap$4.run(RedissonMap.java:1256) [redisson-3.12.5.jar:3.12.5]    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.48.Final.jar:4.1.48.Final]    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]

Any ideas?


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>