When a gateway sender connects to a gateway receiver and authentication is used, the receiver first determines if the provided credentials are valid. If they are valid, then event processing/dispatching is allowed.
However, once the initial authentication is performed, it is possible that the gateway sender stops processing events if the connection with the receiver is destroyed and the credentials used are no longer valid (disallowed, password changed, etc).
This is an edge case where the ack reader thread is the first to attempt to acquire the connection, rather than the dispatcher thread. The ack reader thread currently does not have the proper retry logic for authentication exceptions, while the dispatcher thread does. We should ensure that connection retries occur regardless of which thread gets the authentication exception.