Generic Resolver
The Generic Resolver
component will resolve the configured fields from the incoming message to the corresponding migration.id
based on the document found by the configured query.
Handlebars
This component lets you use Handlebars templates. More information about Handlebars can be found in this section
Configuration
Connection string
A MongoDB connection string.
Example: mongodb://<username>:<password>@localhost:27017/<databaseName>
Here <databaseName>
is the database to do the look-up in.
Use TLS
Whether or not to use TLS in case your mongoDB requires TLS.
Allow Invalid Certificates
Checking this will disable certificate validation. Warning: specifying this option in a production environment makes your application insecure and potentially vulnerable to expired certificates and to foreign processes posing as valid client instances.
Certificate Authority File
One or more certificate authorities to trust when making a TLS connection. In order to access the local filesystem, the XILL4_WORKDIRS
environment variable must be set to the path of the directory to be accessed.
Example: .\ca.pem
Enforce strict mode
When strict mode is turned on, every itemToResolve
must be resolved for a given input. Else an error will be thrown and no output will be sent.
Configuration
The configuration is an array of itemsToResolve
. Each of these objects has a fieldToResolve
, a query
and a fallback
value (optional).
Example:
{
"itemsToResolve": [
{
"fieldToResolve": "source.location",
"query": { "source.id": "{{source.location}}" },
"fallback": 23
},
{
"fieldToResolve": "source.properties.mainDep",
"query": { "source.id": "{{source.properties.mainDep}}" },
"fallback": 50
}
]
}
Field to resolve The key from the input data whose value will be modified. The value to resolve can be an array or a single value.
- single value: gets replaced by the migration ID of the document the query returns.
- array: each of the values gets replaced by the migration ID of the document each query returns.
Query The DB query to find a document whose migration.id we want to resolve with.
Fallback The value that the field must be resolved with if no documents are found.
Input
-
Name: Output
-
Description: Data input: the input that receives the actual data messages.
-
Example
{
"source": {
"properties": {
"mainDep": "156"
}
}
}
-
Output
-
Name: Output
-
Description: The input data with some field(s) resolved.
-
Example:
{
"source": {
"properties": {
"mainDep": "12"
}
}
}
-
The Concept of Resolving
The Generic Resolver component allows you to resolve id’s that change during the migration process. The following diagram explains this process with some examples.
First input
All the fields resolved
Second input
No query result, results in an error. Same applies to when there is a result but no migration.id
If a fallback is configured, use that.
Third input
No query result, fallback is configured and used.