Search code examples
mongodbfiwarebroker

FIWARE context broker storing all data to mongodb


I have installed fiware context broker and I am sending data to it using the localhost:1026/v1/updateContext end point.

Everything is working properly and I am able to get and visualise the data being sent. As orion is a broker service the latest only entity can be received.

Question: I need to save automatically the historical data to a mongo db database. Orion save only the latest 2 entries. STH and Cygnus is not doing the job since they require a lot of configuration both in sending data and collecting, storing etc.

Is there anyway to automatically save all data being sent to orion? And group them by service ids?

Thank you in advance.


Solution

  • Solution Playing around with context broker, I altered the way that orion stores the data to the auto generated mongodb. When one send data to the orion the id of the json will be always the servicepath, the id of the json and the type. Therefore new data gets overwritten. We need to change that by having another element in the id that is incremental therefore new entries are saved. I am not sure if this is a clumsy solution but is definitely more scalable since we don't need subscriptions.