I read the "Custom notifications" section in the NGSIv2 specification and I still have doubts in how to make this work.
Do I have to put in my subscribe POST the following code as a payload?
"httpCustom": {
"url": "http://foo.com/entity/${id}",
"headers": {
"Content-Type": "text/plain"
},
"method": "PUT",
"qs": {
"type": "${type}"
},
"payload": "The temperature is ${temperature} degrees"
}
How would be a complete payload with a httpCustom for a subscribe with Authentication/Authorization?
Lastly, is really necessary to use Rush, as stated at Rush Relayer? In this case, we have to use a "third-party" software that was updated almost 3 years ago. Why not Orion provides this? I would appreciate some help regarding this too.
The following
httpCustom
could be used:The token will expire from time to time. Thus, it should be renewed at a regular interval, modifying the
httpCustom
element with the new token (usingPATCH /v2/subscriptions/<id>
operation, see NGSIv2 specification for details).Regarding Rush, it is not necesary if you can achieve the HTTP-to-HTTPS with some equivalent software. Native HTTPS notifications at Orion has been identified as a topic of interest and even there was a pull request with code implementation in that line. Currently it isn't a priority, however contributions related with this are welcomed :)
EDIT: the above
httpCustom
configuration will make Orion sending notifications including thatX-Auth-Token
header. Thus, it is supposed that at theurl
endpoint (e.g.http://example.com/some/path
in the example above) the authentication elements able to process theX-Auth-Token
header will be listening (typically, a Policy Enforcement Point -PEP- Proxy).UPDATE: since verion 1.7.0, Orion implements native HTTPS notifications (i.e. without needing Rush).