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

protobuf deserialization warning for string keys #621

Closed
solaristhesun opened this issue Mar 8, 2021 · 9 comments · Fixed by #640
Closed

protobuf deserialization warning for string keys #621

solaristhesun opened this issue Mar 8, 2021 · 9 comments · Fixed by #640

Comments

@solaristhesun
Copy link

The README file states "If, for example, keys are not in Protobuf format, key-message-type can be omitted, the same for value-message-type.". That is what I did because I am using protobuf deserialization for the values and strings for the keys. Why am I seeing the warning "Protobuf deserialization is configured for topic [...], but message type is not specified neither for a key, nor for a value" on every message?

My configuration looks like this
deserialization:
protobuf:
descriptors-folder: "/app/protobuf_desc"
topics-mapping:
- topic-regex: "topic1|topic2"
descriptor-file: "kafka.desc"
value-message-type: "DataTypeX"

@solaristhesun
Copy link
Author

The deserialization works correctly. It's just the warning message that bothers me.

@tchiotludo
Copy link
Owner

@xakassi, any idea ?

@xakassi
Copy link
Contributor

xakassi commented Mar 9, 2021

Hi, guys!
It is really strange. So the message is exactly "Protobuf deserialization is configured for topic [...], but message type is not specified neither for a key, nor for a value"? Topic name is [...]? Weird.

It seems like this strange topic matches the regex here:
https://github.com/tchiotludo/akhq/blob/dev/src/main/java/org/akhq/utils/ProtobufToJsonDeserializer.java#L115

But actually no rules are configured for it, so the warning appears:
https://github.com/tchiotludo/akhq/blob/dev/src/main/java/org/akhq/utils/ProtobufToJsonDeserializer.java#L125

Actually we do not have the latest AKHQ version with Protobuf yet in our company. But we are planning to get it really soon. Next week or 2 weeks, I suppose. So I will check it on our real data and our customers configs. I will let you know!

@solaristhesun
Copy link
Author

It is really strange. So the message is exactly "Protobuf deserialization is configured for topic [...], but message type is not specified neither for a key, nor for a value"? Topic name is [...]? Weird.

Yes.

image

@xakassi
Copy link
Contributor

xakassi commented Mar 9, 2021

@solaristhesun So the topic name is actually not "...", but some real topic name "bga-data" (as on the screenshot)? Does this topic name match your regex ("topic1|topic2" is just an example, right, but actual value is different)?

- topic-regex: "topic1|topic2"
descriptor-file: "kafka.desc"
value-message-type: "DataTypeX"

Could you, please, provide full AKHQ config? It would be better to see full and real (as much as it possible) values of the config to figure out what can be wrong.

@solaristhesun
Copy link
Author

Yes, it was an example. I tried to anonymize it in order to not leak any sensitive information :). But anyways, here es the full configuration:

  AKHQ_CONFIGURATION: |
    akhq:
      connections:
        kafka-cluster:
          properties:      
            bootstrap.servers: "kafka:9092"
          deserialization:
            protobuf:
              descriptors-folder: "/app/protobuf_desc"
              topics-mapping:
                - topic-regex: "bga-data|oxy-data"
                  descriptor-file: "kafka.desc"
                  value-message-type: "MValueSet"
                - topic-regex: "patients"
                  descriptor-file: "kafka.desc"
                  value-message-type: "Patient"       

@xakassi
Copy link
Contributor

xakassi commented Mar 17, 2021

I reproduced this bug! Really it is a little bug in my code. I will fix it! PR will be soon :)

And yes, it is harmless, just an annoying message on UI.

@solaristhesun
Copy link
Author

@xakassi Thank you very much!

@xakassi
Copy link
Contributor

xakassi commented Mar 18, 2021

Hi, @tchiotludo !
Please, check and merge my PR, when you are free, it is really minor change, it was such a stupid mistake in my code 😮

tchiotludo pushed a commit that referenced this issue Mar 18, 2021
Fix #621

When configure topic regexes for Protobuf deserialization, topic keys maybe not in Protobuf format, in that case key-message-type can be omitted. The same for value-message-type.
But there is a bug in the code, it shows a warning "Protobuf deserialization is configured for topic [%s], but message type is not specified neither for a key, nor for a value.", when message type is configured only for a key or only for a value.

It should be show only when both key and value message types are not configured.

Co-authored-by: Taisiia Goltseva <tado0618@netcracker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants