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

Disconnection during subscription is not propagated #551

Open
guillaumelamirand opened this issue Nov 10, 2022 · 0 comments
Open

Disconnection during subscription is not propagated #551

guillaumelamirand opened this issue Nov 10, 2022 · 0 comments

Comments

@guillaumelamirand
Copy link

Expected behavior

When a disconnection occurred after a successful connection and during subscription, and if there is no more reconnect attempt expected, the error should be propagated as it does if the same error occurred during the initial connection.

Actual behavior

Currently the error is not propagated because when an error occurred after a successful connection, the obverser is null in MqttConnAckFlow, l69.

image

To Reproduce

Steps

  1. Create a container with the hivemq/hivemq4:latest image
  2. Implement a simple client with this extra disconnected listener that will reconnect 3 times and then should propagate an error
.addDisconnectedListener(context -> {
                if (context.getReconnector().getAttempts() >= 3) {
                    context.getReconnector().reconnect(false);
                }
            });
  1. DO NOT START the hivemq container and run you client, after few seconds (3 reconnections attempt) you will get an error as expected
  2. Start the hivemq container
  3. Run you client which should connect successfully
  4. Stop the hivemq container
  5. You will see that the 3 attempts are done as expected butthen the parent observer being null, nothing else happens.

Details

  • Affected HiveMQ MQTT Client version(s): 1.3.0
  • Used JVM version: OpenJDK Runtime Environment Zulu11.54+23-CA (build 11.0.14+9-LTS)
  • Used OS (name and version): macOS 12.6
  • Used MQTT version:
  • Used MQTT broker (name and version): Docker image hivemq/hivemq4:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants