oscerd commented on issue #1512:
URL:
https://github.com/apache/camel-kafka-connector/issues/1512#issuecomment-6632220737
Sorry for the long silence here. The postgresql-sink Kamelet still
unmarshals the JSON body into a Map and binds each `:#name` parameter as is, so
a nested object reaches the driver as a `java.util.LinkedHashMap`, which it
cannot bind to `jsonb`. On 4.22.x you can serialize that field in the query
with the Simple `toJson` function of the Camel 4.22 runtime, without changing
the message contract, for example `camel.kamelet.postgresql-sink.query=INSERT
INTO software_versions (id, versions) VALUES (:#id,
CAST(:#${toJson(${body[versions]})} AS jsonb))`. We checked that camel-sql then
binds the string `{"common":"1.0.0"}` for that parameter, but did not run it
against a live PostgreSQL. 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.
---
_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]