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
A MongoDB connection string.
Example: mongodb://<username>:<password>@localhost:27017/<databaseName>
Here <databaseName>
is the database to do the look-up in.
Whether or not to use TLS in case your mongoDB requires TLS.
Allow Invalid CertificatesChecking 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 FileOne 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
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.
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
}
]
}
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.
The DB query to find a document whose migration.id we want to resolve with.
FallbackThe value that the field must be resolved with if no documents are found.
The Concept of Resolving
The Generic Resolver component allows you to resolve IDs that change during the migration process. The following diagram explains this process with some examples.
First inputAll the fields resolved
Second inputNo 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 inputNo query result, fallback is configured and used.
Inputs | Outputs
Data input: the input that receives the actual data messages.
Example:
{
"source": {
"properties": {
"mainDep": "156"
}
}
}