简体   繁体   中英

Can You Access Java System Properties From Pentaho Kettle?

We run Kettle from our Java Application. It has its own way of loading configuration from a remote area. In addition, our Java Application sets up and runs the Kettle Core.

I was wondering if system properties can be passed directly into the Kettle Engine, or if they are readily available somehow. Is there a transformation to simply read passed in System Properties?

I haven't been able to find a transformation or any documentation on this, or anyone trying to do this.

Start kettle pdi, create new transformation add "Get variable" step. Press "Get variables" button at bottom and you will see all different variable including the one present system properties.

在此处输入图片说明

The Get variable mentioned by @simar read, among named parameters, the file called kettle.property which sits in the home directory of the executing server. This is allows you to run PDI with different parameters in dev and prod, without tweaking the application at java level.

An other way is the Get System Info step, which gives you an impressive set of system parameters.

The Get variables step that others have mentioned is the way to go. Note however that though this will work for Java runtime variables, it doesn't work for System environment variables like those you set in Control Panel (on Windows) or using export on Linux. To pass variables to PDI you can set them in kettle.properties, or pass them using "-Dname=value" in the call to Java or the Set Environment Variables menu of the help menu. See https://help.pentaho.com/Documentation/5.1/0L0/0Y0/090/020/000/000 for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM