Closed lcary closed 5 years ago
Hello @dhayha, what's required to get this pull request merged in? I'm trying to upstream our changes so that we don't have to maintain a fork. It should be compatible with the existing use cases, since the schema registry / avro deserialization capability is controlled via an optional flag. I can make any style/test/etc adjustments, just say the word.
Sorry for taking so long to get back to you. We definitely appreciate the contribution!
The main concern I have is that the MessageInspector
now has to know whether the message uses Avro or JSON. One way to abstract this concept would be to define a MessageDeserializer
interface that could be used by the MessageInspector
to deserialize messages using whatever format necessary. If this could be auto-detected, great! However my instinct says that we'd need some kind of control on the UI (e.g. radio buttons, drop down) to allow the user to select what type of message format to use (maybe with a configurable default). Then, based on the user's choice, instead of passing in a schema URL, the controller passes in a MessageDeserializer
instance
David, thanks for the feedback. I’ll move the deserialization logic to a MessageDeserializer interface and then I will investigate if auto-detection is feasible.
On Tue, Nov 27, 2018 at 10:26 AM David Hay notifications@github.com wrote:
Sorry for taking so long to get back to you. We definitely appreciate the contribution!
The main concern I have is that the MessageInspector now has to know whether the message uses Avro or JSON. One way to abstract this concept would be to define a MessageDeserializer interface that could be used by the MessageInspector to deserialize messages using whatever format necessary. If this could be auto-detected, great! However my instinct says that we'd need some kind of control on the UI (e.g. radio buttons, drop down) to allow the user to select what type of message format to use (maybe with a configurable default). Then, based on the user's choice, instead of passing in a schema URL, the controller passes in a MessageDeserializer instance
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HomeAdvisor/Kafdrop/pull/33#issuecomment-442099401, or mute the thread https://github.com/notifications/unsubscribe-auth/AGdAcNUgo43V3QFWjhqRqOa57xUf8JiUks5uzVnAgaJpZM4Yeu-f .
@dhayha the changes you suggested have been incorporated into this pull request (see: https://github.com/HomeAdvisor/Kafdrop/pull/33/commits/4c079edccbada1cb9cb34e458cb1726a5cd40d7c). Could you please take another look when you have some time?
This pull request has the following features:
AvroMessageDeserializer
class to display Avro-serialized messages, which are indented for readability using GSON.This change has been tested for viewing both normal and Avro-serialized Kafka messages, and should be backward-compatible with the existing Kafdrop use cases.
See the below screenshot for an example of the new "Message Format" dropdown and Avro-deserialized messages:
See the README changes for new configuration settings in CLI form.