How to manage configuration within a TIBCO Streaming project

How to manage configuration within a TIBCO Streaming project

book

Article ID: KB0076039

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10

Description

After we supplied Production configuration parameter values in the EventFlow fragment configuration, the values were incorrect for Development and the typecheck errors interfered with building the application.

How can we work temporarily with incorrect configuration?
How can we provide configuration which is only correct in a different environment?

Issue/Introduction

Project setup using src/test/configurations folder

Resolution

There are several alternatives available to help with this which may used separately or together to improve StreamBase Studio's use of fragment configuration in a TIBCO Streaming project.
 

A. Turn OFF Build Automatically

In StreamBase Studio, when automatic typechecking interferes with other activities, you may turn it off using the menu: Project > Build Automatically, as found here:

Using the Project, Build Automatically menu switch

Some minimal typechecking will still occur with "Build Automatically" turned off, but this setting does prevent any errors from begin registered in the "Problems" view and require further cleaning.

You may then typecheck on-demand using the "Refresh" (F5) key when an EventFlow Editor is the current view, or "Refresh Project Typecheck Environment" (Control-F5) key.

NOTE: To remove errors from the Problems View, there are two actions which may be needed:
  a) With an EventFlow Editor active for a module in the project, use menu: Project > Clean..., and in the dialog select that project and click the "Clean" button.
  b) Right-click the main project folder in the Project Explorer and choose menu: Maven > Update..., and by default also performs a "clean" on the projects selected.
 

B. Use Test Configurations

This allows Studio to use configuration which is correct within the Development environment, and use different configuration when built and deployed.

StreamBase Studio uses any configuration it finds under src/main/configurations and src/test/configurations, and for typechecking prefers configurations found in src/main/configurations.

The first time you run a .sbapp as a fragment in Studio, Studio creates a Run Configuration for it with default configuration which refers to src/main/configurations. You may change this at any time later to only reference src/test/configurations, and as long as there is NO configuration in src/main/configurations, the configuration from src/test/configurations will be used. (If you do not change the Run Configuration, then when launching the fragment in the "Test/Debug" perspective the configuration from src/test/configurations will NOT be used.

If when run, the application reports error " Reference to undefined parameter" and stops, the Run Configuration created for a fragment references the configuration path where configuration is not found.

To resolve this, edit the Run Configuration, Main tab, to select the appropriate project path here:
Shows the configuration path selection in a Run Configuration
 

C. Use Default Parameter Values and Substitutions When Deploying

This allows the configuration to present to Studio values that are correct within the development environment and values for deployment configuration to be determined later when the node is installed.

This is described on the product documentation page:
  TIBCO Streaming > Configuration Guide > HOCON Configuration Introduction > HOCON Substitution Variables

Supply substitutions when running ' epadmin install node' by adding the command-line parameters:
  substitutions="name=value,name2=value2"
or 
  substitutionfile=mysubstitutions.prop
where " mysubstitutions.prop" has the format:
 name=value name2=value2
(You may use any filename for the properties file, as long as it has this format.)
 

What NOT to do...

Do not put engine configuration in the EventFlow fragment src/main/configurations if that fragment may be used with other fragments in the same deployment Application Archive (the same node). Doing so is likely to conflict with the configuration supplied by the other fragments. Use configuration from src/test/configurations while developing. Then in the Application Archive project, supply a single sbengine or lvengine configuration in that project's src/main/configurations which satisfies the requirements of all included fragments.