I am using Azure Service Bus JS sdk to receive messages from a ASB topic. The receiver is using the default mode (i.e. the Peek) mode. And I call completeMessage() in my message handler. What I am seeing is, the message handler is being called multiple times with the same message. And the sender only sends the message once.
const myMessageHandler = async (messageReceived) => {
this.receiver.completeMessage(messageReceived);
// process messageReceived
.....
}
this.receiver.subscribe({
processMessage: myMessageHandler,
processError: myErrorHandler
});
Can you please tell me what can be the issue? I think ASB is delivery the message multiple times despite the receives already complete the message.