Hi
I am a newbie at Streamset and its DC. I am currently trying to connect to Cumulocity IoT and streams device measurement to store them into a file. Cumulocity offers a public REST API and it is possible to subscribe to real-time measurements once the client is connected. So what i m trying to achieve in my pipeline is as per below:
- create an handshake with Cumulocity IoT
- Subscribe to the measurement channel with the client ID generated in the response of step 1
- Receive the measurements and store them
For step 1, I used as Origin the HTTP Client. It does connect to Cumulocity and does generate a clientId. However, I would like for the origin to just send 1 request and stops sending any other handshake request afterwards. At the moment it is sending handshake request continuously and therefore generating continuously different clientId which is not what I want. How do I limit this stage to send only 1 request? As a temp workaround I put the stage as Batch mode, with a batch size of 1 and a connect Timeout of 1sec. But this is a bit dirty and would like to know the proper way to handle the sending of 1 request only?
For step 2, I need to use the generated clientId from step 1 inside the body of my POST request in step 2. However I always have some syntax issues and I am not sure how to extract the field and use it within the body. Is is possible to use an extracted field from my response in the Handshake within the body? Can you please help ?
For step 3, I have no idea if it is all possible to accomplish. Indeed, once the subscription is established, then Cumulocity will automatically sends the measurements to the created channel and they will be in JSON. Which SDC stage(s) could i then use to ensure i receive those measurements in a streaming mode? The pipeline will be subscribed to the channel but I dont know how to say “now listen to some JSON messages which will be coming at different intervals and parse them”.
Thank you