Giter Club home page Giter Club logo

Comments (8)

kamalaboulhosn avatar kamalaboulhosn commented on August 10, 2024

Can you explain a little more what you are trying to do? What is the format you want the data written in when sent to Pub/Sub? In what format is the data you've written to Kafka stored?

from pubsub.

OuesFa avatar OuesFa commented on August 10, 2024

Thanks @kamalaboulhosn for your help!

Yes, so I'm trying to sink data from Kafka topics that has been written using kafka-avro-serializer, so basically there are byte arrays within the topics, containing the schema ID registered within the Confluent Schema Registry then the payload of the event itself.

I would like to copy the data from those topics to Pub/Sub, in JSON target format for instance.

I would like the connector to read the data, deserialize it then convert it to json and send to PubSub topic.

That's what does for instance the GCS sink connector using the following confs

      "value.converter": "io.confluent.connect.avro.AvroConverter",
      "value.converter.schema.registry.url": "http://localhost:8081",

from pubsub.

kamalaboulhosn avatar kamalaboulhosn commented on August 10, 2024

I believe the notion of the schema registry is a concept specific to Confluent Kafka and not part of the generic, open-source Kafka connect infrastructure. The GCE connector you link to is provided by Confluent, whereas this one is not. At this time, we do not support any lookup of schema in a schema registry via this connector.

from pubsub.

OuesFa avatar OuesFa commented on August 10, 2024

Ok so for now the only way to read avro from kafka topics would be to provide avro file with the schema embedded within every kafka message?

from pubsub.

kamalaboulhosn avatar kamalaboulhosn commented on August 10, 2024

You can dump the Avro messages into the Cloud Pub/Sub as-is since they are just bytes. You'd then have to rely on your subscribers to decode the messages. If all messages on a topic use the same schema, then you could potentially take advantage of Pub/Sub's schema support.

from pubsub.

OuesFa avatar OuesFa commented on August 10, 2024

Actually we use Kafka topics with several schemas. For instance UserDeleted & UserCreated messages have different schemas but need to be stored in the same topic partition to ensure ordering.

from pubsub.

kamalaboulhosn avatar kamalaboulhosn commented on August 10, 2024

Yeah, so in that case, there is no way to convert the Avro into another format within the connector. You could store your schema in Pub/Sub and then manually attach the path to it as an attribute in your messages so that you can pull the schema and decode messages, though this would require your Kafka publisher to publish with the metadata in the headers.

from pubsub.

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.