Working with nJAMS Client for Mule4#
This chapter describes basic topics to work with nJAMS Client for Mule4, like enabling Tracing or creating Extracts. For more details see also nJAMS Server User Guide.
Tracing#
Enable Tracing allows you to monitor more details with regards to a particular activity. When Tracing is on, you can see the input and output data an activity, in other words you can see what comes in into the activity and what goes out. You can use nJAMS GUI to configure Tracing. Select an activity from process diagram and click on the light bulb icon.
Additional settings regarding Tracing can be configured by opening the Tracing combo box and selecting Trace settings
:
In the following dialog, you can define a period of time for which Tracing is active. As soon as the time has ended, Tracing is automatically stopped. Alternatively, the number of Tracings made can be limited. Enabling “Deeptrace” will allow Tracing on all activities of subsequent processes. Please refer to nJAMS Server User Guide for more information.
Alternatively you can modify nJAMS Client for Mule4 configuration file <name_of_service>_njams4.json
and add or update Tracing without using the User Interface.
This is an example for enabling Tracing:
{
"HTTP /rockets": {
"tracepoint" : {
"starttime" : "2019-11-05T09:57:43.610",
"endtime" : "2019-11-05T10:12:43.610",
"iterations" : 0,
"deeptrace" : false
}
}
}
Note
After modifying nJAMS Client for Mule4 configuration file, you have to restart MuleSoft Runtime Engine instance to make the settings become effective.
Extracts#
An Extract is a non-invasive way to add nJAMS events with regards to specific activities. You can use nJAMS GUI to configure an Extract:
The following dialog allows you to configure an Extract:
You can also modify nJAMS Client for Mule4 configuration file <name_of_service>_njams4.json
and create, update, or delete Extracts without using the nJAMS User Interface.
This is an example for creating an Extract:
{
"HTTP /rockets": {
"extract": {
"name": "ExtractruleType",
"extractRules": [{
"attribute": "businessService",
"attributeType": "attribute",
"ruleType": "value",
"rule": "SuperHeroService",
"inout": "out"
}, {
"attribute": "eventType",
"attributeType": "event",
"ruleType": "value",
"rule": "info",
"inout": "out"
}
]
}
}
}
Note
After modifying nJAMS Client for Mule4 configuration file, you have to restart TIBCO Adapter for Database Service instance to make the settings become effective.
Configuration Stores#
nJAMS Client for Mule4 must persist dynamic configuration information such as Trace Points and Extracts. The client offers two separate options to persist that configuration: file or objectstore.
When deploying to MuleSoft CloudHub any restart of the application will erase any configuration stored in a local file. To overcome this and retain settings over the application’s lifecycle, using a persistent objectstore is the best option.
Depending on your choice, add the following lines to nJAMS Client for Mule4 configuration file njams.properties
.
- File:
nJAMS Client for Mule4 defaults to persisting dynamic configurations to a local file. The name and location of the file can be controlled using the following settings:
# Configuration store: file njams.sdk.configuration.provider=file njams.sdk.configuration.file.file=<MULE_WORKING_DIRECTORY>/njams/<njams.mule.domain>_<njams.mule.deployment>_<njams.mule.engine>.json
Note
Make sure to either configure a directory or unique file names to prevent files being overwritten by different applications!
- Objectstore:
nJAMS Client for Mule4 should use a persistent objectstore, when the Mule application is deployed into MuleSoft CloudHub. You may use the following properties to use a particular objectstore. Please see the MuleSoft manuals for further information on objectstores.
# Configuration store: objectstore njams.sdk.configuration.provider=objectstore njams.sdk.configuration.objectstore.name=_defaultPersistentObjectStore njams.sdk.configuration.objectstore.refreshinterval=60
Note
nJAMS Client for Mule4 will automatically compute a key for the configuration using this pattern:
<njams.mule.domain>_<njams.mule.deployment>_<njams.mule.engine>