I am listing to a topic in azure service bus with the following javascript code.
Library and version @azure/service-bus 1.1.2
const sbClient = ServiceBusClient.createFromConnectionString(
config.merchant_event.connection_string
);
const topicClient = sbClient.createSubscriptionClient(
config.merchant_event.topic_name,
config.merchant_event.subcription_name
);
const receiver = topicClient.createReceiver(ReceiveMode.ReceiveAndDelete);
receiver.registerMessageHandler(
merchantEventMessageHandler,
merchantEventErrorHandler
);
As soon as the application starts, it working fine. But if any case connection loss or connection time out, the listener will stop listening.
Can you please advise how to address this. Is there any retry mechanism to enable for reconnect the connection if it is a loss.