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
i am currently in an Organization where the message format used is Cloudevents (https://github.com/cloudevents/spec) .
We are putting multiple event types into the same topic. Each event is a cloudevent byte representation. They contain the event name in the header. The event name will be used eventually when deserializing it back into the dotnet type.
When using Kafkaflow what would be the best way to consume/produce these messages?
Cloudevent is not a serializable object so it will need it to be a byte representation.
Does it make sense that i make a middleware that will write the cloudevent byte representation directly to Kafka and then read the same as a Byte array
or
Does it make sense to build a deserializer middleware that will read the cloudevent type specification and then use a custom type resolver to convert the object back to the right type.
what would be the right approach to use? I want to be able to play nice with other middleware :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
i am currently in an Organization where the message format used is Cloudevents (https://github.com/cloudevents/spec) .
We are putting multiple event types into the same topic. Each event is a cloudevent byte representation. They contain the event name in the header. The event name will be used eventually when deserializing it back into the dotnet type.
When using Kafkaflow what would be the best way to consume/produce these messages?
Cloudevent is not a serializable object so it will need it to be a byte representation.
Does it make sense that i make a middleware that will write the cloudevent byte representation directly to Kafka and then read the same as a Byte array
or
Does it make sense to build a deserializer middleware that will read the cloudevent type specification and then use a custom type resolver to convert the object back to the right type.
what would be the right approach to use? I want to be able to play nice with other middleware :)
Some other supporting documentation on Cloudevents https://github.com/cloudevents/sdk-csharp
"The CloudEvent class is not meant to be used with object serializers like JSON.NET. If you need to serialize or deserialize a CloudEvent directly, always use a CloudEventFormatter such as JsonEventFormatter."
Beta Was this translation helpful? Give feedback.
All reactions