Using datachannels with libmediasoupclient

Hi,
While working with libmediasoupclient, I am facing a puzzling issue. Here it is.

My libmediasoupclient application is creating a dataconsumer on the server side using the dataproducer id of the bot dataproducer. The bot data producer is created on the server side as suggested by the mediasoup authors and the dataconsumer creation is successful. I subsequently create a libmediasoupclient side dataconsumer with the dataproducerid returned from the server side. The client side dataconumer creation is successful. Now I listen to the onMessage event listener on the dataconsumer for any incoming message that the bot producer from server side may send. I successfully receive the first message from the server side bot producer on the onMessage listener in the client side. But the issue is, I don’t receive any further message from the second message onwards which are being sent from the server side bot producer.
I am a bit puzzled because when the onMessage event on the client is getting triggered for the first message, why is it not happening from the second message onwards.
The way I am sending the message from the server side is the same. I am using the bot dataproducer.send() to send the message for all the occasions.

Am I missing something here?

Thank you.

I got the issue. The issue is not related to the dataconsumer. In this case, when the first message is received, I do some processing based on the message. It seems, until the processing is complete, the client is not receiving the second message. I figured this out by temporarily commenting the processing part of the code to check further messages are received or not and I was able to receive all the messages if I don’t do any further processing based on a message. Therefore, I may need to do the further processing in a separate thread without blocking the main thread. I’ll figure things out from here.
Thanks.