Search code examples
ibm-integration-bus

How to set Fileinput directory value from properties?


If my flow is File Input -> Compute Node -> File Output, how can I set the File Input directory value based on a User Defined Property? I will have a different file drop directory for dev, qa and prod and don’t want this hard coded anywhere. If it cannot be done using my User Defined Properties, how else can I accomplish this?


Solution

  • Create configurable properties per environment and define the input directory there.

    Properties for dev:

    # File: yourapp-dev.properties
    yourflow#File Input.inputDirectory = ./yourapp/dev/in
    

    Properties for qa:

    # File: yourapp-qa.properties
    yourflow#File Input.inputDirectory = ./yourapp/qa/in
    

    Apply the properties per environment. For dev it would be:

    mqsiapplybaroverride -b yourapp.bar -p yourapp-dev.properties -r
    

    Now you can deploy yourapp.bar to the dev environment.