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

Decode error when decoding records which sent from native kafka client #16

Open
iamazy opened this issue Feb 16, 2023 · 0 comments
Open

Comments

@iamazy
Copy link
Contributor

iamazy commented Feb 16, 2023

In kafkas, when I consume records which produced from native kafka client, it always got Decode Error. but everything is OK when I use Producer in kafkas.

Currently I ignore the DecodeError with a little changes like this.

    pub fn decode<B: ByteBuf>(buf: &mut B) -> Result<Vec<Record>, DecodeError> {
        let mut records = Vec::new();
        while buf.has_remaining() {
-            Self::decode_batch(buf, &mut records)?;
+            if let Err(_) = Self::decode_batch(buf, &mut records) {
+               break;
+            }
        }
        Ok(records)
    }

There seems has no record lost.

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

No branches or pull requests

1 participant