1

How can I pass data to my Spring Cloud DataFlow Task?

I need to pass some POJO on which my Task will be operate. Is it possible?

Markiza
  • 444
  • 1
  • 5
  • 18

1 Answers1

0

You can pass the properties when launching the task. If you want to pass a POJO then make sure your task understand that POJO as properties when passed as arguments.

For passing the properties, you can refer here

Ilayaperumal Gopinathan
  • 4,099
  • 1
  • 13
  • 12
  • Thanks for your answer, I've seen that reference, but could you provide please an example of how can I pass props as POJO and how my task can understand them? I'm using `DataFlowTemplate` for launching task, and all that I see everywhere, when passing them - is that properties are just strings. For example, here is the `launch` method signature in `TaskOperations`: `long launch(String name, Map properties, List arguments);` And now I can't figure out how to pass POJO, using properties:( – Markiza Aug 16 '17 at 17:04
  • 1
    You can't pass a POJO for either of those for a simple reason. You can't pass a POJO as a command line arg or an environment variable. We don't do any form of serialization before configuring these two and both are fundamentally Strings. – Michael Minella Aug 16 '17 at 17:55
  • How can we pass the Task Argument programmatically to Spring Batch Step? – PAA Apr 17 '20 at 14:11