-
Notifications
You must be signed in to change notification settings - Fork 71
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
Sending binary data #159
Comments
Hey @ggallea, Have a look at this example. |
The example is serializing a string. I have numbers (float and int32) to send |
@ggallea |
How can I serialize (types other then string) to bytes (using the serialize function in SchemaRegistry)? |
Hello @mostafa, Would it be possible to directly send an For the moment I do the following: const body = encoding.b64decode(".............") // returns an ArrayBuffer
writer.produce({ messages: [{
value: schemaRegistry.serialize({
data: Array.from(new Uint8Array(body)),
schemaType: SCHEMA_TYPE_BYTES,
}),
key: ...
}]}) It works but it means a lot of transformations. |
Hey @c-meier, you can read the reasoning behind making the serdes explicit in the following PR and its linked issues: |
Hello @mostafa, My point wasn't about exporting the serdes functionality to JS (I think it works quite well). But that I think it would make more sense for EDIT: K6 seem to be using ArrayBuffer as the return type of most JS method which deal with binary data (see issue) |
@c-meier |
I am Reading data from binary file and trying to send the data I read to kafka.
I get the following error:
cannot unmarshal object into Go struct field Message.messages.value of type []uint8
What am I doing wrong?
Thanks
The text was updated successfully, but these errors were encountered: