spring-attic / jdbc

Apache License 2.0
11 stars 18 forks source link

Error parsing the payload starting from v2.0 #48

Closed sabbyanandan closed 5 years ago

sabbyanandan commented 5 years ago

As a user, while repeating the SCDF sample on http | jdbc, I see the following error.

stream create --name mysqlstream1 --definition "http --spring.cloud.stream.bindings.output.contentType='application/json' | jdbc --tableName=names --columns=name"

http post --contentType 'application/json' --data '{"name": "sridhar"}' --target http://mysqlstream1-http-v1.cfapps.io

error:

 2019-03-29T08:59:16.75-0400 [APP/PROC/WEB/0] OUT 2019-03-29 12:59:16.755  INFO 14 --- [.mysqlstream1-1] o.s.c.s.a.j.sink.JdbcSinkConfiguration   : Could not find value for column 'name': EL1008E: Property or field 'name' cannot be found on object of type 'byte[]' - maybe not public or not valid?

notes: It appears the payload needs to be explicitly handled given the default wire format. The following definition works.

stream create --name mysqlstream1 --definition "http --spring.cloud.stream.bindings.output.contentType='application/json' | jdbc --tableName=names --columns=name:payload

http post --contentType 'text/plain' --data "sridhar" --target http://mysqlstream1-http-v1.cfapps.io