question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RMapCache adds some special characters before

See original GitHub issue

Redisson version - 3.12.3 Java version - 11

final TypedJsonJacksonCodec codec = new TypedJsonJacksonCodec(String.class, JSONObject.class, new ObjectMapper());
JSONObject value = new JSONObject(new HashMap<String, String>() {{
    put("a", "b");
}});
RMapCache<Object, JSONObject> myMapCache = redissonClient.getMapCache("myMapCache", codec);
myMapCache.put("key", value, 14, TimeUnit.DAYS);
RLocalCachedMap<Object, JSONObject> myLocalCachedMap = redissonClient.getLocalCachedMap("myLocalCachedMap", codec, LocalCachedMapOptions.defaults());
myLocalCachedMap.put("key", value);

With use of codec: RMapCache HGETALL returns

  1. “"key"”
  2. “\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00\x00\x00\x00\x00{"a":"b"}” from redis-cli.

RLocalCachedMap returns

  1. “"key"”
  2. “{"a":"b"}” from redis-cli.

My question - what is the special characters in RMapCache. And how can i read json without this characters by call HGET on raw Redis?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
asarkarcommented, Aug 13, 2021

@Slava96 I’m seeing the same behavior. What did you end up doing?

0reactions
jagansankaracommented, Apr 19, 2022

I’m also facing same issue but for different scenario. Key which inserted through Redission library have additional characters and works fine if I read it again through Redission but not with other platform like Python library or redis-cli.

Our requirement is to read/write same key from different application (here it is SpringBoot & Django).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Search java string for 'special' characters before inserting into ...
I am trying to convert from MS Access to DerbyDB. However some varchar fields have 'special' characters, such ...
Read more >
Uses of Interface org.redisson.api.RFuture - javadoc.io
Returns approximated number of unique elements added into this instances and other instances defined through otherLogNames . RFuture<Void>, RStreamAsync.
Read more >
Java based Rate limiter with Redis + RollingLimit + backoff
During certain redis operations, I am facing PartitionSelectorException. Caused by: io.lettuce.core.cluster.PartitionSelectorException: Cannot determine a ...
Read more >
Java data structures with Redis. Introduction to Redisson
RMapCache <Integer, String> map = redisson.getMapCache("someMap"); map.put(20, "oldobj", 20, ... set.add(new MyObj("value"));. MyObj obj = queue.peek();.
Read more >
How to remove all special characters from String in Java ...
You should spend some time sharing your regular expression skill, as it's one of the powerful tools for debugging and troubleshooting. It is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found