Comments (6)
Hm we can investigate that but full generic mappings are always very dangerous. A lot of bad stuff can happen when using it. Our core concept is that we use a specific topic as a key for a mapping. So when the topic is /devicename/measurementname
the payload including keys should always be the same (except the values of course).
You can also use a template where you define all possible keys by hand and map them accordingly in just one mapping.
from cumulocity-dynamic-mapper.
Hi @simeonthefirst ,
you can try to use the following sample, to generate dynamicaliy new nodes:
This will transform the source msg. as follows:
If your mapping requires more flexibility, then I recommend using the programmatic approach. This means writing your own mapping class in Java and upload this to the mapper. A sample implementation can be found here.
The extension mechanism is documented here.
Pls. let me know if this helps.
--Christof
from cumulocity-dynamic-mapper.
Hi,
thank you ! Your exampe, @sagIoTPower gives the flexibility to ignore the key-string on the device-side message what is part of what i wanted to achieve.
It does not enable me to change the measurement or series name on cumulocity side of the mapping. To realize a mapping like this (see below) , i will need to implement an extension. I will let you know when i do.
(device side)
{
"Measurementname": "Airsensor",
"Seriesename":"Humidity",
"value":10,
"unit":"%",
}
-->
(cumulocity side)
{
"Airsensor": {
"Humidity": {
"unit": "%",
"value": 10
}
}
"time": ....
...
}
from cumulocity-dynamic-mapper.
Hi @simeonthefirst,
I added a new setting RepaiStrategy = REMOVE_IF_NULL
and added a sample, mapping number 23 ( flexMeasurement).
Could you pls. take a look if this helps and fits for your use case?
Regards Christof
from cumulocity-dynamic-mapper.
Hi @sagIoTPower ,
thank you! I did not had the time to test it jet, but took a look at the example. For me it looks like the measurement-/fragmentname can now vary between different pre-known names. Or do i get it wrong?
More important for me would be to set the measurement-/fragmentname and/or also series name to something you don't now at the time when you create the mapping. I'm sorry if this was a misunderstanding.
best regards,
Simeon
from cumulocity-dynamic-mapper.
Hi @simeonthefirst,
the graphical mapper aims to cover mapping where the structure of the messages is well understood and stable. This allows for a certain flexibility.
In your case you would like to define a mapping for messages with varying structure.
Could you take a look at the sample processor extension for JSON payload?
The sample defines a mapping as a processor extension in a Java class. This allows a higher degree of control over how to handle different payload structures.
The additional RepairStrategy.CREATE_IF_MISSING
helps in this case as well.
The release v.3.1.7 covers this new strategy.
Regards
Christof
from cumulocity-dynamic-mapper.
Related Issues (20)
- UI for configuring the broker connections allows to copy an existing connection configuration.
- Bug v3.3.6: Outbound dispatcher will set the status of operations even there is no mapping defined HOT 1
- Replace paho mqtt client HOT 2
- Make use of MQTT v5 features in client
- Review concept for separation of templateTopic (mappingTopic) & subscriptionTopic HOT 2
- could not proceed from 2nd stepper step to 3rd stepper step, once you went backward HOT 1
- Support for connection to an MQTT broker over websocket HOT 1
- Support to connect to Kafka brokers.
- Server Path is prefilled with "mqtt" and required
- Remove Mapping name as it is useless HOT 2
- Subscribing to inactive mapping HOT 3
- External Id type is blank after disable/enable Map device identifier HOT 1
- Deleting Mappings does not clear selection HOT 1
- 'Active for connectors' is not updated when activate/deactivate mapping HOT 1
- when mapping is activated subscriptions are created even for outbound mappings HOT 1
- When deactivating/ activating a connector, the "active for connector" is not refreshed HOT 1
- Microservice of mapper not work properly on Thick Edge HOT 8
- Move some properties from properties files to tenant options HOT 1
- Improve First-usage of Dynamic Mapper
- Improve async logic to scale better
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cumulocity-dynamic-mapper.