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

modify to throw MqttException if MqttAsyncClient.connect() is called when there is no message broker #1022

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

angry-2k
Copy link

fix : modify to throw MqttException if MqttAsyncClient.connect() is called when there is no message broker (message broker service is down due to a failure, or address is incorrect...)

For users who use the library, debugging is very difficult unless exceptions are thrown in such cases.
Currently, if the message broker attempts to connect to a situation that does not exist, there is a risk of performing the next logic without any exceptions being returned.
Of course, the getException() of the IMqttToken instance returned to the connect() call can be checked for an Exception, but it is difficult to use because it is not synchronized.
I think it's right to make an exception in this particular case.

issue #1020

angryEK2 and others added 2 commits November 21, 2023 19:11
…alled when there is no message broker (message broker service is down due to a failure, or address is incorrect...)

For users who use the library, debugging is very difficult unless exceptions are thrown in such cases.
Currently, if the message broker attempts to connect to a situation that does not exist, there is a risk of performing the next logic without any exceptions being returned.
Of course, the getException() of the IMqttToken instance returned to the connect() call can be checked for an Exception, but it is difficult to use because it is not synchronized.
I think it's right to make an exception in this particular case.
…alled when there is no message broker (message broker service is down due to a failure, or address is incorrect...)

For users who use the library, debugging is very difficult unless exceptions are thrown in such cases.
Currently, if the message broker attempts to connect to a situation that does not exist, there is a risk of performing the next logic without any exceptions being returned.
Of course, the getException() of the IMqttToken instance returned to the connect() call can be checked for an Exception, but it is difficult to use because it is not synchronized.
I think it's right to make an exception in this particular case.
@angry-2k angry-2k closed this Nov 21, 2023
@angry-2k angry-2k reopened this Nov 21, 2023
@angry-2k angry-2k changed the title Develop modify to throw MqttException if MqttAsyncClient.connect() is called when there is no message broker Nov 22, 2023
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.

2 participants