Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start sending appropriate error message to the clients, if the broker mapping is not configured for particular vhost #79

Merged
merged 1 commit into from
May 23, 2022

Conversation

Chinmay1412
Copy link
Contributor

We have acquireConnection function in ConnectionSelector class, which basically performs farm and backend mapping check for connecting clients during initial handshake. And once it is successful, the Session class starts connecting to the broker.

And in case of failure, it immediately close the socket without notifying anything on client side. So this PR sends the Close method with appropriate message to the client before socket closure, so that client can know the reason of sudden disconnection. We might get different errors while performing broker mapping check, but clients will not be aware about the terms. So it is a good idea to send common error message to the clients.

It seems we can add more checks in acquireConnection, before initiating handshake with broker. So this PR also changes the name of the implementation class to represent wider scope of the class. And the PR is also modifying interface class name to represent explicitly interface e.g. ConnectionSelectorInterface.

libamqpprox/amqpprox_session.cpp Outdated Show resolved Hide resolved
driveTo(5);

EXPECT_TRUE(session->finished());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

… mapping is not configured for particular vhost
@Chinmay1412 Chinmay1412 force-pushed the connection-selector branch from 36b3658 to 5412802 Compare May 23, 2022 10:22
@Chinmay1412 Chinmay1412 merged commit 20f0acd into main May 23, 2022
@Chinmay1412 Chinmay1412 deleted the connection-selector branch May 23, 2022 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants