Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-354

Access environment variables from JSL job xml

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 1.3.0.Beta7
    • 1.2.4.Final, 1.3.0.Beta6, 1.2.5.Final
    • jberet-core
    • None

    Description

      job xml can access java system properties with property substitution, but sometimes certain configuration data is available in environment varialbes, but not as system properties. There should be an easy way to access them from job xml.

      Accessing environment variables from JSL job xml is useful in cloud environment, where containers/POD expose and exchange configuration data through environment variables.

      A workaround is to add a job listener that can add these environment variables to system properties. Note: that will not work, since JSL property resolution happens before job listener's beforeJob method.

      Another workaround is to pass these environment variables as batch job parameters for every batch job operations that involves db access.

      Or if the user has control over how the java process is launched, add them as command line options.

      Yet another workaround is to handle that outside JBeret, earlier in the request cycle, for example, in a ServletContextListener that copies certain environment variables to system properties.

      Attachments

        Activity

          People

            cfang@redhat.com Cheng Fang
            cfang@redhat.com Cheng Fang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: