question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[#8] Duplicate logic for parsing of Kafka headers

See original GitHub issue

I found that the classes RecordUtil and KafkaMessageHelper implement the same use case: getting and decoding Kafka headers. It would be good to have this implemented only once.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
calohmncommented, Feb 16, 2021

Well, taking the first header and not causing an error is still not my preference, but at least there’s some consistency to it. So, ok. Interestingly, the Kafka Headers interface only has a lastHeader method for getting a single header.

1reaction
kaniyancommented, Feb 11, 2021

@b-abel @calohmn We already deal with handling of multiple headers having the same key in Hono. In case of HTTP headers, we take the first header value. We could apply the same here in case of kafka headers too and keep it uniform. IMHO what is important, is to clearly document the behavior in the specifications.

EDIT: In case of MQTT property bag, if there are more than one values for the specified name, then the first value is used.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 5 Things Every Apache Kafka Developer Should Know
Record headers give you the ability to add some metadata about the Kafka record, without adding any extra information to the key/value pair...
Read more >
Documentation - Apache Kafka
It is an extensible tool that runs connectors, which implement the custom logic for interacting with an external system. In this quickstart we'll...
Read more >
Adding Custom Headers in Kafka Message - Stack Overflow
Kafka v0.11.0.0 adds support for custom headers. You can add them when creating a ProducerRecord like this: new ProducerRecord(key, value, headers, .
Read more >
Duplicate headers · Issue #2335 · spring-projects/spring-kafka
The DLT_ headers are for "classic" (blocking) retries with the default DeadLetterPublishingRecoverer . The ones without the DLT_ are for non- ...
Read more >
org.apache.kafka.common.header.Headers Java Examples
This page shows Java code examples of org.apache.kafka.common.header. ... headers = getHeaders(); Headers copy = new RecordHeaders(headers); copy.add(new ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found