eclipse-paho / eclipse-paho/paho.mqtt.java

Provide connection state API during reconnection attempts when disconnecting

Open
#1,079 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
919
PR merge metrics
No merged PRs in 30d

Description

**Description:**
During MQTT client startup, if the server is disconnected, the client automatically attempts to reconnect. If the application calls disconnect() during this reconnection phase, it only receives a "client is connecting" notification. This makes it difficult to properly handle disconnection during reconnection states.

**Problem:**
Currently, there's no way to:

Determine if the client is in a reconnection attempt state

Get the current connection state when disconnecting during reconnection

Properly synchronize disconnect operations with reconnection logic

**Suggested Solution:**
Provide an API to:

Expose the current connection state (including reconnection status)

Allow checking whether reconnection attempts are in progress

Contributor guide

Open the contributing guide

Research direction

Start by tracing the MQTT client startup, reconnection-attempt, and disconnect entry points described in the issue, including where the "client is connecting" notification is produced. Define the connection states and synchronization behavior needed during reconnection, then verify that callers can observe the current state and determine whether reconnection is in progress.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.