I am using httpclient processor as one of my steps, as follows (specified in Shell syntax as I'm testing locally, newlines added for readability here):
dataflow:>stream create --name test <sourceConfig> |
httpclient --httpclient.urlExpression='''https://host/restUrl'''
--httpclient.body-expression=null
--headers-expression=\"{Accept: 'application/json', <otherHeaders>}\"
| log" --deploy
The service returns a Map with a single entry, with a list as a value.
{ "key" : [ { "name" : "theName", ... }, ... ] }
By default, the REST call response body is interpreted as a String. I'd like to specify a --httpclient.expected-response-type option to have the body parsed into JSON. Per the docs, I need to specify a java.lang.Class<?> for this, and I'm not sure what class to specify, even after much digging in docs, unit tests, and POMs. Does anyone know?
Or, do I need to perform the conversion manually in the --reply-expression? Either way, I think I still need to know which JSON library Spring Cloud Stream is using, unless I'm missing something.