Fixes the NPE that occurs when a subscription connection is abruptly removed. The issue was caused by a message duplication. Messages that are failed during delivery were requeued where all the messages that are bound to the subscription are also requeued from another path. As the resolution, avoided requeueing messages when the delivery is failed due to the subscriber being not available.
Purpose
To fix https://github.com/wso2/product-ei/issues/1619 and https://github.com/wso2/product-ei/issues/1613.
Goals
Fixes the NPE that occurs when a subscription connection is abruptly removed. The issue was caused by a message duplication. Messages that are failed during delivery were requeued where all the messages that are bound to the subscription are also requeued from another path. As the resolution, avoided requeueing messages when the delivery is failed due to the subscriber being not available.
This fix provided by @sdkottegoda .