I want to know how to implement HTTP - MQTT architecture in NodeJS environment.
The scenario:
1) HTTP post request is received from third party server (Google Smart Home Server)
2) This request is converted to MQTT and sent to remote device.
3) Wait for MQTT response from device or timeout (4 seconds).
4) Once the MQTT response is received, convert the response to HTTP and send as a response to request in step 1. If response is not received within timeout then send failure response based on data present in request body.
The code should handle multiple concurrent requests.
Here is the link for API I am implementing [login to view URL]
OnExecute method doesn't have response object and should either resolve promise or return response.
This is a sort of a complicated task but I have done it already , I have controlled my Home Automation devices through Google Home. My home automation works on MQTT protocol.