0

I want to create a catalog of java.util.functions so when I feed in A,B,C then the app will run those functions in the same order flowing the output to the next function?

The above statement is basic, which I would love to hear ideas. Eventually, the workflow will be fed an input as json for example to orchestrate this.

Also need to support reactor and where we can map, flatmap or filter.

For now all functions will be available in the project, and will be part of a Spring Boot app.

I am thinking, I can make the functions as beans, pull them and execute in order, although not sure how to orchestrate the functions in case there is a filter and then further if I want to use reactor where I will have map or flatmap.

Please share any ideas or any frameworks worth looking into.

Thanks

Rami Del Toro
  • 1,130
  • 9
  • 24

1 Answers1

2

I think using a workflow orchestrator platform would be a great way to implement this use case.

You probably don't need that since all your functions are available in the same service, but using an orchestration platform will offer a lot flexibility as your service grows in complexity or when the need for orchestrating your use case across multiple services comes up.

An option for workflow orchestration is Netflix Conductor. Here is an article that talks about how to use Conductor to manage sequential tasks. Conductor platform has features to run flows in a distributed fashion as well, such as fork join, decisions etc. and this can be done across different services.

Ex: Service 1 hosting Function A, Service 2 hosting Function B and C. And you can build a flow running A -> B -> C while passing/referring to outputs from the previously executed functions without having to build any state management systems.

The above article was written as a response to this Stackoverflow question which is very similar to yours.

For clarity - I used to work at Netflix on the team that built and open sourced Conductor.

boneys
  • 76
  • 2