• Flux News
  • Flux Blogs
  • David
  • Eric
  • Arul
  • Brian
  • Flux Website

eric @ flux

1 Posts tagged with the runtime_configuration tag
0


Flux jobs are executed in a job tree. The job tree is similar to the concept of a file system where jobs (like files) are stored in namespaces (or folders). Each job has a namespace where it executes. All jobs execute underneath the root namespace and can execute in sub-namespaces.

For example, a Flux job that runs a monthly payroll report for a client may execute under the following namespace:

/client1/reports/payroll/monthly/Report1000

With many clients, you could easily have hundreds of reports to process. Using one job template, or flow chart, for all of the monthly payroll reports would be ideal. There will be some issues that we will need to address in the design of the job template to ensure we have a proper design to serve all of the clients.

Each client will have a different server (FTP, SFTP, etc.) where the report files are to be uploaded. We will need to support this somehow. There may be other variables between the monthly payroll reports for each client as well.

Flux has a built-in mechanism that can really assist us in satisfying the requirement of variable data between our jobs. This feature is called the "runtime configuration". You can store any Java object in the runtime configuration. String properties can be loaded from a standard Java properties or any property can be created using the Flux Java API.

Here's an example of a runtime configuration file:

/payrollReportDir=reports/payroll

/username=reports

/client1/reportServer=reports.client1.com

/client2/reportServer=reports.client2.com

/client3/reportServer=reports.client3.com

/client4/reportServer=reports.client4.com

There are five runtime configuration properties defined in this file. There is one defined at the root level and one property defined for each client (client1-4).


We can easily access these properties from our job using the Flux runtime variable substitution mechanism. For example, we can using ${runtime reportServer} as the server name in any File action or trigger. We can also use ${runtime payrollReportDir}. The runtime configuration tree will be searched for a matching property starting in the namespace where the job is executing. All jobs will upload reports to the “reports/payroll” directory as the reports user on the file server and any job running under /client1 will use the reports.client1.com server.


http://blogs.fluxcorp.com/servlet/JiveServlet/downloadImage/1039/reportServerCriteria.png
Runtime configuration properties allow you to have properties whose value changes based on where the job is executed. This feature allows you to build dynamic job templates that can simplify your enterprise jobs.

0 Comments 0 References Permalink