-
Notifications
You must be signed in to change notification settings - Fork 201
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
Kinesis record reading: thawing non-nippy data #36
Comments
Yeah, I guess I assumed if you were using clojure to read from kinesis that you were putting the records into kinesis from clojure, in which case they'd be nippy frozen. Bad assumption. I'll parameterize the unwrap function. |
The fix version is on Clojars. If you want control over serialization and deserialization, you can pass a nio.ByteBuffer to calls to (put-record), in which case it won't be nippy/frozen, and supply a :deserializer function to (get-records) or (worker!) calls, which will the nio.ByteBuffer as their only arg and can return anything, which will be available under the :data key, same as before. I think that should work for your case, no? |
Michael, thank you. This sounds great! It is not likely I will have a chance to test it until Feb 3, but it does seem exactly what we needed in our scenario. On Sat, Jan 25, 2014 at 1:36 PM, Michael Cohen notifications@github.com
|
I have Kinesis records that contain Snappy-encoded blocks such that when a process that decodes each block yields a sequence of strings like this:
So each string is an EDN value (a basic Clojure literal).
Amazonica seems to assume that data must be nippy-serialized. So when I try:
I get:
Perhaps I am missing it, but I don't see a simple way to tell Amazonica not to do that and instead give me raw bytes, which I could decompress and decode however I like.
So, is there a way to do that?
So far I see that you have
unwrap
function that is used directly and indirectly byget-records
and byprocessor-factory
, respectively. Would be wonderful if I could supply my own version of unwrap, instead of nippy-thawing version ofunwrap
.The text was updated successfully, but these errors were encountered: