Skip to content
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

Formatting #338

Closed
2020testuser opened this issue Jan 21, 2021 · 5 comments
Closed

Formatting #338

2020testuser opened this issue Jan 21, 2021 · 5 comments
Labels
question Further information is requested

Comments

@2020testuser
Copy link

Hi,
Could anyone please help me?
I'm using CloudEvent and getting my avro data in byte[] format.
What is the best approach to convery my avro byte[] in json format?
I see CloudEvent sdk-java doesn't support avro and so wondering what options I have?

Thanks in advance!

@slinkydeveloper
Copy link
Member

I'm using CloudEvent and getting my avro data in byte[] format.

Do you mean that the data field of the cloudevent contains avro, so the payload is avro? Or you mean that the full event is encoded as avro, per spec https://github.com/cloudevents/spec/blob/v1.0.1/avro-format.md

@slinkydeveloper slinkydeveloper added the question Further information is requested label Jan 22, 2021
@2020testuser
Copy link
Author

@slinkydeveloper - Very sorry for the delay. I have the data field as avro in cloudevent.
Wondering what options I have. Thanks!

@slinkydeveloper
Copy link
Member

slinkydeveloper commented Jan 30, 2021

In that case, you need to get the bytes of the data with CloudEventData#getBytes() and then manually invoke the avro deserializer

@slinkydeveloper
Copy link
Member

We might add at some point some deserializer similar to the one we have for jackson, but we need the avro module first, as discussed in #115

@2020testuser
Copy link
Author

@slinkydeveloper - Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants