$ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic mysql_users{"uid":1,"name":"Cliff","locale":"en_US","address_city":"St Louis","elite":"P"}{"uid":2,"name":"Nick","locale":"en_US","address_city":"Palo Alto","elite":"G"}
ksql> CREATE STREAM source (uid INT, name VARCHAR) WITH (KAFKA_TOPIC='mysql_users', VALUE_FORMAT='JSON');Message----------------Stream created----------------
ksql> SET 'auto.offset.reset' = 'earliest';Successfully changed local property 'auto.offset.reset' from 'null' to 'earliest'ksql> CREATE STREAM target_avro WITH (VALUE_FORMAT='AVRO', KAFKA_TOPIC='mysql_users_avro') AS SELECT * FROM source;Message----------------------------Stream created and running----------------------------ksql>
$ kafka-avro-console-consumer \--bootstrap-server localhost:9092 \--property schema.registry.url=http://localhost:8081 \--topic mysql_users_avro --from-beginning{"UID":{"int":1},"NAME":{"string":"Cliff"}}{"UID":{"int":2},"NAME":{"string":"Nick"}}
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To post to this group, send email to confluent...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsubscribe@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMMRvL7mFugrvA7p9-%3DTFSPMWp1QO-cWuEcPXOK5m-w_aA%40mail.gmail.com.
Hi again Robin,
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsubscribe@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/a1788be1-2157-4e18-a6fb-0c0a423abeb8%40googlegroups.com.
thanks, Robin.
Hi again Robin,
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMMRvL7mFugrvA7p9-%3DTFSPMWp1QO-cWuEcPXOK5m-w_aA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMMRvL7mFugrvA7p9-%3DTFSPMWp1QO-cWuEcPXOK5m-w_aA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz2r7yz0yY_AG7yeuORjuZzKcavrSWM_UKxKDDRRToY8kw%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMMRvL7mFugrvA7p9-%3DTFSPMWp1QO-cWuEcPXOK5m-w_aA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz2r7yz0yY_AG7yeuORjuZzKcavrSWM_UKxKDDRRToY8kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMOr5uk9TmxvfChbnwDQquvz%3Dmt7QuthngqjoDX7qUUnxA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMMRvL7mFugrvA7p9-%3DTFSPMWp1QO-cWuEcPXOK5m-w_aA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz2r7yz0yY_AG7yeuORjuZzKcavrSWM_UKxKDDRRToY8kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMOr5uk9TmxvfChbnwDQquvz%3Dmt7QuthngqjoDX7qUUnxA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz18i76NxqrU3VZn9uXeuMRuvPJQfFuOiJ_SoUh1oS0rew%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMMRvL7mFugrvA7p9-%3DTFSPMWp1QO-cWuEcPXOK5m-w_aA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz2r7yz0yY_AG7yeuORjuZzKcavrSWM_UKxKDDRRToY8kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMOr5uk9TmxvfChbnwDQquvz%3Dmt7QuthngqjoDX7qUUnxA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz18i76NxqrU3VZn9uXeuMRuvPJQfFuOiJ_SoUh1oS0rew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMPqDZiExNSK5xQ4M9%2BO5ZLqdds90KCTkAPZWxrTuXJZRA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMMRvL7mFugrvA7p9-%3DTFSPMWp1QO-cWuEcPXOK5m-w_aA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz2r7yz0yY_AG7yeuORjuZzKcavrSWM_UKxKDDRRToY8kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMOr5uk9TmxvfChbnwDQquvz%3Dmt7QuthngqjoDX7qUUnxA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz18i76NxqrU3VZn9uXeuMRuvPJQfFuOiJ_SoUh1oS0rew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
I have seen SMTs that "inline" JSON into a Connect `Struct` with a schema. In your example, you'd need a Connect `Schema` object fro the `payload` field, and the SMT infers that schema from the JSON document structure. The trick is that inferencing, and whether the SMT can do that without consulting any other components (like SR). You may have business constraints that dictate what that schema is (or the variations of the schema that are used in practice), which makes this a bit easier.
A best practice for SMTs is that they don't talk to another service. This may be a gray area, however, since an SMT could talk to an external system (e.g., SR) only once initially or very infrequently (when it detects a new structure it hasn't seen). That might be acceptable. But you definitely do NOT want an SMT consulting an external service more frequently than that.
Of course, another approach is to use a Converter. Confluent's Avro Converter, for example, does talk to the SR when it comes across a schema it doesn't know about, and this may range from very infrequent (if the same schemas are used over and over) or more frequently (if schemas evolve frequently). This is also a valid option, and if I went with this option I'd create a custom Converter that instantiated and wrapped another Converter (e.g., Avro) for the actual (de)serialization logic, and my customer Converter could focus on the new logic. One benefit of this approach is that it'd wouldn't require extra configuration logic: the AvroConverter requires the SR URL, which your custom logic could use as well.
(Why not extend the `AvroConverter`? That is an option, but its method and design are not public APIs, and and those methods may change at any point, potentially breaking your custom implementation. By wrapping it you constrain yourself to using only the public API, which will be safe.)
Given the above, I'd probably start with the Converter approach, since that seems to make it simpler to use: really, just change the `value.converter=io.confluent.connect.avro.AvroConverter` property to refer to your new class.
Another reason is that you seem to imply that you're only using the AvroConverter, which makes your custom Converter a little easier since it can probably assume it's wrapping the AvroConverter. If really necessary, though, you could pass in the name of the wrapped Converter implementation class, but that gets a little more complicated.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/b8006133-9c54-47f1-88c0-ac9ba7760790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/44a3c0fc-c637-42a5-b6ce-af83309cb809%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMMRvL7mFugrvA7p9-%3DTFSPMWp1QO-cWuEcPXOK5m-w_aA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz2r7yz0yY_AG7yeuORjuZzKcavrSWM_UKxKDDRRToY8kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAE1jLMOr5uk9TmxvfChbnwDQquvz%3Dmt7QuthngqjoDX7qUUnxA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz18i76NxqrU3VZn9uXeuMRuvPJQfFuOiJ_SoUh1oS0rew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--3
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/4faa1cea-652f-483e-b8d2-c4c4b6a93746%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/CAO8%3Dcz3vCfruaut5G6X9P9Qorx7NvVyQRk_terxHwnbSPp0nqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.