taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.16k stars 131 forks source link

Encoding of MsgPack byte array #115

Closed maarek closed 9 years ago

maarek commented 9 years ago

I am using MsgPack to encode/decode data structures that I send and receive from Redis. What I am finding is that the data sent to redis from Carmine includes "\x00<" appended to the data. This is causing me issues when I retrieve that data from say Python and then unpack the data. If I strip it of "\x00<" the data unpacks properly. Any thoughts on why this null< character is added to byte data from Carmine? I am on version 2.7.0 of Carmine.

ptaoussanis commented 9 years ago

Hi Jeremy,

Carmine adds a prefix to serialized and bin data to allow auto-distinguishing from the two on later read. You can circumvent this by using the raw util. Any arguments wrapped with (raw <arg>) will be written to Redis exactly as-is.

Likewise, you can use parse-raw while reading.

Does that help?

maarek commented 9 years ago

Peter, That's perfect! Thanks for the quick response.

ptaoussanis commented 9 years ago

No problem, cheers! :-)