Pipeline configuration
These configuration items enable you to add a Lua pipeline to Transformer and specify how Transformer is to use it.
Transformer’s pipeline configuration must be kept in a separate configuration file called pipeline.conf . If you’re using the Deployment Framework, put changes and additions to this configuration in <Framework-root>/global_config/overrides/servers/Transformer/etc/pipeline.conf where <Framework-root> is the Deployment Framework’s topmost directory.
|
add-pipeline
add-pipeline
specifies the configuration of a Lua pipeline that is to be loaded into Transformer.
Syntax:
add-pipeline id [string] pipeline-file [string] add-info [array of strings] discard-func [string] exclude-regex [array of strings] flags [integer] initialise-func [string] listener-regex [array of strings] log-flags [integer] nodata-func [string] no-delay-load [boolean] provider-exclude-regex [array of strings] provider-regex [array of strings] request-func [string] required-fields [array of strings] status-func [string] type [integer] udp-command [array of strings] udpsig-func [string] update-func [string] end-pipeline
Option | Type | Default | Description |
---|---|---|---|
array of strings |
|
Specifies extra information that’s added to the pipeline module database (see the Pipeline Database configuration). Each pair of strings in the supplied array is a key + value pair, where the key part constitutes a secondary key in the database. The secondary key + value pair is stored in the database under the primary key For example:
stores the value |
|
string |
[none] |
The name of the Lua function to call when an update is received whose subject matches the The signature of the function must be: The function must return This function is always called on the main thread. |
|
array of strings |
[an empty list] |
A space-separated list of one or more regular expressions used to match (select) the subject names of updates that are not to be processed by this Lua pipeline. You can put multiple instances of this option in the Also see The equivalent option for filtering out the subject names of subscription requests and discard requests is |
|
string or integer |
(no flags specified) |
Flags that specify the behaviour of this Lua pipeline. You can specify a flag by name or numeric value:
Use the
|
|
string |
[automatically generated] |
A unique identifier for the Lua pipeline. This is used by the If you don’t define an |
|
string |
[none] |
The name of the Lua function to call when the script named in The signature of the function must be: The initialise function is called when the script is first loaded; it’s always called on the main thread. Subsequently, it may also be called multiple times, depending on the setting of the Pipeline threads configuration item The script is normally loaded when a matching update is received, but if you also want the |
|
string array |
[any subject matches, unless it’s excluded by |
A space-separated list of one or more regular expressions used to match (select) the subject names of updates that are to be passed to the Lua function specified in the You can put multiple instances of this option in the Also see The equivalent option for selecting the subject names of subscription requests and discard requests is |
|
integer|string |
(no extra logging) |
Flags that specify additional items that can be logged to the
You can only specify one flag value. This means that you can either specify just one type of additional item to log, or you can specify To specify additional logging for dynamically created pipelines, use |
|
string |
[none] |
The name of the Lua function to call when a nodata message is received whose subject (symbol) matches one of the patterns specified by The signature of the function must be: In the implementation of the function, don’t inspect the This function can be called from any of the Lua pipeline’s worker threads (see |
|
boolean |
|
When |
|
string |
[none] |
The name of the file containing the code for the script of the Lua pipeline that’s to be loaded. For example: |
|
array of strings |
[an empty list] |
A space-separated list of one or more regular expressions used to match (select) the subject names of of subscription requests and discard requests that are not to be processed by this Lua pipeline. You can put multiple instances of this option in the Also see The equivalent option for filtering out updates is |
|
array of strings |
[any subject matches, unless it’s excluded by |
A space-separated list of one or more regular expressions used to match (select) the subject names of subscription requests and discard requests that are to be processed by this Lua pipeline. You can put multiple instances of this option in the Also see The equivalent option for selecting the subject names of updates is |
|
string |
[none] |
The name of the Lua function to call when a subscription request is received whose subject (symbol) matches one of the patterns specified by The signature of the function must be: The function must return This function is always called on the main thread. |
|
array of strings |
[an empty list] |
A space-separated list of one or more field names. When the pipeline receives an update (filtered according to the settings of Each field name in the list must correspond to a field name in an |
|
string |
[none] |
The name of the Lua function to call when an update to the status of a subject is received, where the subject matches the The signature of the function must be: where:
This function is called on the pipeline thread for the subject being processed. |
|
integer |
|
The type of this Lua pipeline, as a name or value:
Note that the default setting of this option is not |
|
[array of strings] |
[none] |
A list of UDP commands that this Lua pipeline will respond to. When Transformer receives a UDP command that’s in this list, it calls the pipeline’s Lua function that’s specified by the Example: |
|
string |
[none] |
The name of the Lua function to call when Transformer receives a UDP command. The signature of the function must be: where This function can be called from any of the Lua pipeline’s worker threads (see |
|
string |
[none] |
The name of the Lua function to call when an update is received whose subject matches one of the patterns specified by The signature of the function must be: where the This function can be called from any of the Lua pipeline’s worker threads (see |
logfile
logfile
specifies the filename of the pipeline activity log in which pipeline messages are recorded. All log messages generated using the Logging routines package of the Transformer (Lua) Pipeline Module API are also sent to this file (see the Lua Pipeline Module API Documentation). Pipeline database activity is also recorded in this log. (see database-log-options
in Pipeline database configuration.)
The filename can contain the parameters %a
and %h
At run time, %a
is replaced by the Transformer’s application name (see the DataSource configuration item application-name), and %h
is replaced by the host name of the machine on which the Transformer is running.
Syntax: logfile <log-file-name>
Type: string
Default value: pipeline.log
log-level
log-level
specifies the severity of errors and events that are reported to the pipeline’s log file (see logfile
).
Syntax: log-level <log-level-name>
Type: string
Default value: INFO
Values accepted:
Log-level-name | Description |
---|---|
|
Reports all errors and events. |
|
Reports events and information regarding normal operation, and all events included in the |
|
Reports minor errors and all events included in the |
|
Reports errors and all events included in the |
|
Reports serious errors and all events included in the |
|
Reports critical errors that prevent the pipeline from running. |
pipeline-logflags
pipeline-logflags
specifies flags that make dynamic Lua pipelines log additional items to the logfile
. (A dynamic pipeline is a pipeline that’s created at run-time by another pipeline.)
Syntax: pipeline-logflags <flag-name1> <flag-name2> <flag-name3> …
Type: array of strings
Default value: none
(no additional logging for dynamic pipelines)
Values accepted:
Flag name | Meaning |
---|---|
|
No additional logging |
|
Additionally log received updates |
|
Additionally log received nodata indications |
|
Additionally log received filters |
|
Additionally log timer interactions |
|
All of |
Example:
pipeline-logflags update nodata
This configuration causes all dynamic pipelines to log both received updates and received nodata indications in addition to the standard log items.
To specify additional logging for a non-dynamic pipelines, use the log-flags option of add-pipeline .
|
pipeline-paths
pipeline-paths
specifies a space-separated list of the directory paths where Transformer’s Lua pipeline scripts and libraries can be found. You can separate the scripts and libraries across directories for ease of maintenance.
The directory path can contain the parameter %r
At run time, %r
is replaced by the root directory (application-root
) under which the Transformer runs.
Syntax: pipeline-paths <list-of-directory-paths>
Type: array of strings
Default value: %r/lib/pipeline
(This is where the core Caplin-supplied packages reside.)
Example
Here’s some example pipeline configuration.
add-pipeline # This is a default pipeline type default pipeline-file mydefaultpipeline.lua initialise-func myinitfunc listener-regex ^/I/.*\.L exclude-regex ^/I/VOD.L update-func myupdatehandler nodata-func mynodatahandler provider-regex ^/I/.*\.L provider-exclude-regex ^/I/VOD.L request-func myrequesthandler status-func mystatushandler end-pipeline
-
The pipeline’s specified as a default pipeline, which means that it captures and processes all updates that aren’t caught by other pipelines. You have to explicitly declare that it’s a default pipeline (
type default
), because otherwise the default configuration setting oftype none
would apply, which would mean the pipeline wasn’t a default one. -
Since there’s no
id
option in the configuration, the pipeline’s identifier is automatically generated when the pipeline is loaded. -
The pipeline script is loaded from the file
mydefaultpipeline.lua
in the (default) directory%r/lib/pipeline
and it’s initialised by a call to the functionmyinitfunc()
. -
The
myupdatehandler()
function of the Lua scriptmydefaultpipeline.lua
handles all updates whose subjects have the form/I/<NAME>.L
(specified bylistener-regex
), except the subject/I/VOD.L/
(specified byexclude-regex
). The functionmynodatahandler()
handles all nodata messages received for the same subjects. -
The
myrequesthandler()
function handles all subscription requests for the same subjects, but in this case, the subject filters must be specified byprovider-regex
andprovider-exclude-regex
.The
mystatushandler()
function handles all status change messages received for these subjects.
See also:
-
Reference: Pipeline threads configuration
-
Reference: Pipeline database configuration
-
Reference: Transformer Pipeline SDK (API)
-
How can I… Write a Lua Pipeline for Transformer