I need to write an API, when client invoke that API it publish message on request topic of MQTT and wait for response on response topic. If response topic doesn’t return anything then API should return default response.
My problem is while consuming message from topic. I am able to publish but how I can wait for response (to consuming message) for a specific topic and send it as response or after specific time send default response of API.
I am using Spring 4, Java.