Closed DavidP-B closed 1 year ago
Also I don't undestand this part. ConnectionCount is used to know if there is a reconnection, but always will be reconnect because after the channel created, you sum 1 to connection count, so isReconnect always return true.
this.logger.info("AMQP channel created.");
this.connectionCount++;
const isReconnect = this.connectionCount > 1;
if (isReconnect) {
await this.resubscribeAllChannels();
}
Also I don't undestand this part. ConnectionCount is used to know if there is a reconnection, but always will be reconnect because after the channel created, you sum 1 to connection count, so isReconnect always return true.
The connectionCount
initialized to 0, so first time it will be false (1 > 1 == false).
Could you write repro steps and env?
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
When I'm running moleculer-channels and I got an error, timeout o whatever (an error how cause a reconnection to amqp) when moleculer-channels try to reconnects calls method resubscribeAllChannels. This method always return an error Already tracking active messages of channel XXXX which is located in the method initChannelActiveMessages.
Expected Behavior
No errors and reconnectins as usual.
Temporal solution
I put a try/catch inside resubscribeAllChannels
Question
Is necessary call the method resubscribeAllChannels, because I make some tests commenting this line and all works well.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.