Giter Club home page Giter Club logo

Comments (3)

alfonz19 avatar alfonz19 commented on August 11, 2024 1

Sorry for delay, I had to verify it.
Thank you for your help, you are correct. In our project we have multiple producers and the one producing this specific record was kafka-connect, which was misconfigured. I misread specification, that even custom extensions has to have "ce_" prefix. I thought this rule holds only for cloudevents-specific, known headers. So I fixed kafka-connect configuration and sure enough, everything is fine.

Thanks again for your help!

from sdk-java.

pierDipi avatar pierDipi commented on August 11, 2024

Hi @alfonz19, thanks for reporting, in Kafka, when sending the event, you should see a header ce_whatever having value whatever as opposed to header whatever having value whatever.

This is done by serializer in

public BaseKafkaMessageWriterImpl<R> withContextAttribute(String name, String value) throws CloudEventRWException {
String headerName = KafkaHeaders.ATTRIBUTES_TO_HEADERS.get(name);
if (headerName == null) {
headerName = KafkaHeaders.CE_PREFIX + name;
}
headers.add(new RecordHeader(headerName, value.getBytes(StandardCharsets.UTF_8)));
return this;
}
when calling this
return new KafkaSerializerMessageWriterImpl(headers)
.writeBinary(data);
}

from sdk-java.

pierDipi avatar pierDipi commented on August 11, 2024

how are you writing records to Kafka? Can you share a small reproducer?

from sdk-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.