2

I'm trying to create a dtwin of some sensors putting together eclipse-ditto and node-red frameworks. I'd like to be notified when the "thing" is updated via SSE, so i followed the instruction from the https://www.eclipse.org/ditto/httpapi-sse.html but when i'm trying to envoke the endpoint in this way:
curl -X GET -H 'Accept: text/event-stream' -H 'Authorization: Basic ZGl0dG86ZGl0dG8=' -i 'http://localhost:8080/api/2/things?ids=smart:factory_lwb' the request get stacked forever. I tryed with and without ID, but the result is the same. Could someone help me, please! Thanks a lot in advance,

1 Answers1

1

I'm not sure what you mean by "the request get stacked forever", but if it is what I think you mean, this is exactly the behaviour that is expected.

When you open the connection for an event stream the connection is expected to stay open. You will then receive events on this connection. You might want to add the -N flag to curl in order to make curl immediately print out the data the stream receives, instead of buffering it?

For example open a SSE stream and create a new thing. You will then see the created thing in your stream.

I hope I could help you and thank you for supporting eclipse ditto by asking questions on stackoverflow! :)

Yannic Bürgmann
  • 6,301
  • 5
  • 43
  • 77
  • 1
    Hi Yannic, using the REST client in the browser the behaviour was looking strange for me, i was expecting some ACK from server. Using cURL instead after a couple of minutes i make it works. Sorry for the thread, looks like everything works as described in the tutorial, probably u can just warn people what it could take a while, or it was just the matter of the my installation instance latency. Thanks a lot anyway! – Liudmila Dobriakova May 21 '19 at 08:12