Closed restjohn closed 6 years ago
I would classify this more as a bug, myself, as there is no workaround as far as I can see.
I agree this is a bug; the expression should make no assumptions that the column comes from a payload property, which is what "payload." + value
does, even though that is, by far, the most common use case (clearly, since nobody has reported this to-date).
The column could come from a header headers['foo']
or be something more complex, as has been reported.
This is going to be tricky to fix, however, without breaking all existing apps using the current assumption.
https://github.com/spring-cloud-stream-app-starters/jdbc/blob/e72160b34b59a753c62cf023922187d6688214ec/spring-cloud-starter-stream-sink-jdbc/src/main/java/org/springframework/cloud/stream/app/jdbc/sink/JdbcSinkConfiguration.java#L91
I want to use the following column expression in my JDBC Sink starter:
Unfortunately, when I use that expression, the code linked above results in an exception:
What is the purpose of adding a second,
payload.
-prefixed version of the same expression? This seems superfluous to me, and in my case prevents me from using the JDBC Sink starter.