ably / kafka-connect-ably

Kafka Connector for publishing data from Kafka to Ably
https://ably.com/solutions/extend-kafka-to-the-edge
Apache License 2.0
11 stars 6 forks source link

Support `Struct` fields in chanel and message name mapping #134

Closed jaley closed 1 year ago

jaley commented 1 year ago

Currently it's only possible to refer to the Kafka topic and the record key in our message.name and channel configuration properties, by making use of #{topic} or #{key} in those patterns.

This is quite limiting in common use cases, because:

The channel and message name mapping feature is most useful when users can refer to fields within a record. This is possible when a schema registry and an appropriate data converter is configured and the incoming records will therefore have Kafka Connect Struct data. The Ably connector already supports this, as it's needed for automatic conversion of data to JSON before sending over a channel. If, however, the incoming data is unstructured, we can't do this.

We would need to require that any field referenced can reasonably be converted to a string (for use in either channel name or message name) and that in the case of channel name mappings, the resulting channel name adheres to Ably's channel naming restrictions.

sync-by-unito[bot] commented 1 year ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3689

jaley commented 1 year ago

Initial thoughts on how to implement this:

Recommendation:

Later:

Limiting support to just STRUCT and scalars for now means we can get away with a simple string split on the . character and regexes. Map and array accessors and the hashing notation may be the point at which we need to embed a parser library, which is a bit more work.

jaley commented 1 year ago

Closed in #141