MS-(A) sends hundred of messages to a Azure service bus - topic, on the other side MS-(B) receives those messages by implementing AMQP subscribe
this.subscription = this.receiver.subscribe({
processMessage: this.onMessage,
processError: this.onError
});
async onMessage(message) {
await this.eventHandler(message)
}
public async eventHandler(message): Promise<void> {
console.log('before')
await Utilities.sleep(5000)
console.log('after')
}
The result is that the messages received in a sync mode instead of parallel. Meaning that till the handler not sends response, the other messages won't be received. I'd expect to read more messages till go to await.
current result: before (waiting for 5 sec) after
expected result: before before before ... after (after 5 sec)
How to implement it so messages keep received while the other are sleeping or in other words as a parallel mode?