You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are correct on the alternate XRANGE signature. But I am really using XREAD. Let me update the title and to clarify.... XREAD only is problematic.
raylau1234
changed the title
StreamEntry (XRANGE / XGET) does not support binary because it uses Map<String, String>
StreamEntry (XREAD) does not support binary because it uses Map<String, String>
Oct 3, 2023
I see there are alternate signatures for xread as well. Let me see of those help. I found the StreamEntry ones first. Give me a few minutes to explore and will udpate.
OK, List<byte[]> xread(XReadParams, Entry<byte[], byte[]>... streams) is a possible workaround, but is cumbersome bec I need to deserialize the byte into the map of key / message id / values. i.e. I need to replicate everything that List<Map, Entry<String, List<StreamEntry>>> xread(XReadParams, Map<String, StreamEntryID>) is doing in terms of decoding with STREAM_READ_RESPONSE, STREAM_ENTRY_LIST, etc. (but skipping the SafeEncoder.encode() and keeping the binary there).
StreamEntry uses a Map<String, String> for fields.
As a result, binary data which contains illegal utf-8 sequences get mangled.
Reproduce by using XADD with a key or value which contains an illegal utf-8 sequence like 0xc3 0x28.
Retrieve via XREAD.
Expected result -- API to get byte array instead of a String, which is lossy with illegal utf-8 sequences.
The text was updated successfully, but these errors were encountered: