However when i deploy and start this process, the message is received at message received task, but it isn’t processing to the rest of the flow, unless and until, I hit the rest api: and the process variables are also not getting creating. localhost:8080/engine-rest/message
Yes the referenced implementation about can we have intermediate (message) catch event for that yes we can have.
But if I understood correctly your query is about how to proceed with process flow in case of intermediate message catch event. For that, when intermediate message catching event is reached and waiting there, at that point of time you can opt from below option:
Intermediate message throw event in case of BPMN (with the same name as catching message ofcourse; same as your 2nd approach in original post)
Rest (engine-rest/message) call in case of WS
By using Message correlation API if using Java code
As given in the document “When a token arrives at the message intermediate catching event it will wait there until a message with the proper name arrives”.