Skip to content

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