-
Notifications
You must be signed in to change notification settings - Fork 44
Deployment Unit
The user code and config is bundled as a Deployment unit and deployed to Flux runtime.
Deployment units are located on local disk. The path to the Deployment units directory needs to be mentioned in flux configuration file located at flux/runtime/src/main/resources/packaged/configuration.yml with key deploymentUnitsPath. The default is /tmp/workflows
# change this path as contents of /tmp are deleted on boot/periodically
deploymentUnitsPath: "/tmp/workflows/"
The structure of a deployment unit is as follows
deployment_unit_name
|
|-- main/
|-- lib/
|-- flux_config.yml
|-- other configuration files which belong to client
main directory contains the client jar which contains workflow code. This directory is mandatory and in case of fat jar, keep the jar in this directory.
lib directory contains the jars the client jar is dependant on. This directory is optional and can be empty.
flux_config.yml file contains deployment unit specification configuration and is mandatory.
workflowClasses is a list of class names, it tells Flux which classes to scan for @Workflow and @Task annotations. It is a mandatory param.
workflowClasses: ["com.flipkart.flux.examples.externalevents.ManualSellerVerificationFlow",
"com.flipkart.flux.examples.externalevents.ManualSellerVerificationService",
"com.flipkart.flux.examples.externalevents.NotificationService",
"com.flipkart.flux.examples.externalevents.SellerDataService"]
In case you are using Google Guice for DI, you can mention the Guice Module class of your code, using key guiceModuleClass. Flux creates an injector with the provided module, uses the injector while instantiating user classes. This param is optional.
guiceModuleClass: "com.flipkart.flux.examples.externalevents.SellerVerificationWorkflowModule"
You can mention the no.of dedicated Akka actors need to be created to execute a task using executionConcurrency. This number is per JVM. If the number is not mentioned the default value routers.default.instancesPerNode of configuration.yml is used.
taskConfig:
com.flipkart.flux.integration.SimpleWorkflow_simpleStringReturningTask:
executionConcurrency: 5