swift-server / swift-kafka-client

Apache License 2.0
83 stars 23 forks source link

Get Message body #167

Closed Urkman closed 5 months ago

Urkman commented 5 months ago

How can I get the body of the message. I know, that it is in message.value as a ByteBuffer. But how can I decode it?

I'm all new to Kafka, so perhaps I need some tipps here :)

Here is an Image of there message shown in KafkaUI...

Bildschirmfoto 2024-06-17 um 16 39 34
FranzBusch commented 5 months ago

It depends what is in your message. From a high level perspective the message is just a collection of bytes you need to know what the producer send. It could be JSON or protobuf or any other encoded format.

Urkman commented 5 months ago

Thanks, it is a Protobuf message :)