oscerd commented on issue #1653: URL: https://github.com/apache/camel-kafka-connector/issues/1653#issuecomment-6632214088
Sorry this was left hanging. The camel-kafka-connector sink does not set camel-kafka consumer headers such as `kafka.KEY`. It puts the record key in the Camel header `camel.kafka.connector.record.key`, and it only maps Kafka record headers whose name starts with `CamelHeader.` (the prefix is removed, see https://camel.apache.org/camel-kafka-connector/next/user-guide/basic-configuration.html). So on 4.22.x, with the Kafka header sent as `CamelHeader.myheader`, a query like `INSERT INTO mytable (message, mykey, myheader) VALUES (:#message, :#${header.camel.kafka.connector.record.key}, :#${header.myheader})` should work; we checked that camel-sql binds those three values as expected, but not against a live database (if the header holds JSON, `header.converter=org.apache.kafka.connect.storage.StringConverter` keeps it as plain text). Closing this as a usage question; if it does not work for you on 4.22.x, please open a new issue with the version, connector config and stack trace, or a sk on [email protected] or https://camel.zulipchat.com. --- _Claude Code on behalf of Andrea Cosentino_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
