Search code examples
spring-cloud-dataflow

Dataflow launcher Payload Java


I build a stream with an http source and a sink dataflow-launcher to execute a spring batch task named batchPY546Task To launch this task i set the localFilePath=path-of-the-file parameter. So in the documentation, with the http source it's possible to pass informations thru the payload.

https://github.com/spring-cloud-stream-app-starters/tasklauncher-dataflow/blob/master/spring-cloud-starter-stream-sink-task-launcher-dataflow/README.adoc

{
  "name":"foo",
  "deploymentProps": {"key1":"val1","key2":"val2"},
  "args":["--debug", "--foo", "bar"]
}

I try many syntaxes : curl http://localhost:57110 -H"Content-Type:application/json" -d '{"name":"batchPy546Task", "args":{"localFilePath=/tmp/remote-files1/BLM-54.00.01_Multicontrat_Creation_IDCRT011-b.xml"}}'

and all are wrongs

Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.ArrayList<java.lang.Object> out of START_OBJECT token at [Source: (byte[])"{"name":"batchPy546Task", "args":{"localFilePath=/tmp/remote-files1/BLM-54.00.01_Multicontrat_Creation_IDCRT011-b.xml"}}"; line: 1, column: 34] (through reference chain: org.springframework.cloud.stream.app.task.launcher.dataflow.sink.LaunchRequest["args"]) at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) ~[jackson-databind-2.10.2.jar!/:2.10.2]

How can I pass the parameter lcalFilePath to my task ?

Versions : dataflow server 14.2 skipper server 2.3.2 datafmow auncher is up to date and compatible with dataflow server 2.4.2.

Regards


Solution

  • args must be a json list "args":["localFilePath=/tmp/..."]