Tutorial & Interface
eiConsole Tutorial Basic
Using Environment Properties
In this tutorial we’ll cover the uses of environment properties, how to configure them, as well as what they’re for. This tutorial expands on eiConsole basics, such as configuring Listeners and Transports and testing.
How to Use This Example
Download the Interface to get started. (Once logged into the eiConsole it immediately shows up in your “PIE” inbox for use.)
Note: if you are not logged in to the eiConsole, or have arrived at this page via a browser, you will be prompted to login before the interface downloads into your eiConsole “PIE” inbox. Or if you have not downloaded and installed a FREE eiConsole Trial you will have the opportunity to register after you click the Interface Download link. Once you are logged in the interface will automatically download into your “PIE” inbox. First, you’ll see a screen pop up indicating that a new product is ready for download. Select the Download Now button. Once you’ve downloaded the Interface you can drag it into your current Working Directory and begin.
Next, follow the tutorial and walk through it step-by-step.
Most modules in the eiConsole, such as Listeners, Processors, Transports, and so forth, make use of configuration items, which so far we’ve largely configured as static, constant values. For an example, we’ll use a Directory / File Listener’s configuration:
In this case, we’ve typed (or browsed to) the value for the “Polling Directory” item. It’s currently set to “C:\in.” We’ve also set the “Polling Interval” to check the specified directory for new files every five seconds. For building our Interfaces and testing them, this approach has been quite workable. However, suppose that we need to move this interface from our workstation to another or, more importantly, to a testing or development environment. As is, we’d need to load up the Route in an eiConsole on that machine and make the appropriate changes. When we then moved the interface from the testing machine to a staging environment or even to production, we would once again need to edit the Route.
Now, suppose our interface is made up of many Routes, each with multiple Listeners and Transports. Some might be interacting with folders, meaning we’d need to change the paths each time. Others might be querying and updating databases, meaning we’d need to change connectivity information, including usernames, passwords, connection strings, driver names, etc. each time. The problem of moving interfaces from environment to environment quickly scales up as the complexity of an interface grows.
Fortunately, there’s a pretty simple, straightforward solution: environment properties. Environment properties are property values defined in an external file that exists, relative to an interface, at a fixed location (the root directory). We can edit and use the contents of this file from within the eiConsole by going to the Edit menu and selecting “Environment Properties”:
Defining our source directory and polling interval
Here we have the contents of the environment properties file shown in a table. The “key” is the name of the property and the “value” is its current value. Let’s try defining our source directory and polling interval here by adding two rows: the first key is source_directory, and its value is C:\in; the second key is polling_interval, and its value is 5.
We could add as many such keys and values as we wished, so long as each key has a unique name. It’s generally a good idea to qualify keys by intent or through some namespace. We can then click the “Save” button to save our changes:
After saving, click “Close” to close the dialog. Returning to our Directory / File Listener’s configuration, we’ll note a button visible to the right of each configuration item:
This button enables “enhanced configuration values,” meaning it provides access to various dynamically evaluated expressions, including our defined environment properties. Click the button and it should be replaced by three more:
The first button allows us to select from defined environment properties, the second allows us to construct OGNL expressions (covered in another tutorial), and the third returns us to “standard” configuration values. Click the first button and it will open a dialog showing our defined properties:
For this item, we’ll select “source_directory.” Select it in the table, then click the “Select” button:
Our configuration item’s value now looks like this:
The “$$source_directory” part tells us that we’re looking for an environment property named “source_directory.” The “=C:\in” is simply telling us the current value of that property, as understood by the eiConsole.
Repeat the exercise for the Polling Interval item:
We now have a file called “environment-settings.conf” – this is the external file. You can open it in any standard text editor; do so:
When we move our interface between systems, we now need only update this single file. If the interface exists already on a particular system then our deployment is simply a matter of not copying over it.
Using Environment Properties in the eiConsole module configuration items allows for externally defined values for Listeners, Transports which you can now use. Next, move on to more advanced topics like Expressions – Using OGNL.