Experimenting with the Admin API

Oh dear, we've both done the same thing. I've created a HTTP<-->MQTT proxy, I asked in the forum and then went ahead and built it.

There is no file storage just direct communication with the target NR instance. For this to happen there is a flow on the target NR instance:

It also proxies the websocket connection so that debug message actually appear in the dummy NR instance.

The proxy code is this:

The top half is the http handling of the dummy NR instance. Basically what it does is store a reference to the http response object, send out a mqtt request to the target NR instance, obtain the response and send it out on the http response object stored in the flow.

The bottom half is the websocket handling, again just converting websocket requests to mqtt messages and waiting for responses.

The final part is the serverless NR instance that I point to the proxy. Loading it into the browser gives me the complete flow from the target NR instance in my browser.

Fun project and extremely useful for those that only have an MQTT connection to the their headless NR instance (somewhere in a dark, damp place!).

2 Likes