You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mqtt-kafka: delete the consumer group offsets of a session when it expires #3204
When an MQTT session expires, binding-mqtt-kafka discards the session offsets stored under <clientId>#offsets (#3170, first part, #3184) but leaves the committed offsets of the consumer group <groupIdPrefix>-<clientId> in Kafka. A client that connects after its session expired is then handed the backlog of the expired session.
On Clean Start=1 the group offsets are now deleted before the new session is established (#3170, second part, #3202). Expiry has the same gap and is not covered there.
Specification statements
Read in the full OASIS texts before designing or testing:
v5.0 4.1: the Server's Session State includes the QoS 1 and QoS 2 messages sent but not completely acknowledged and those pending transmission. In this binding that state is the group offsets of the subscribe streams.
v5.0 3.1.2.11.2 (Session Expiry Interval): the Session State is discarded when the interval elapses after the Network Connection closes.
v3.1.1 has no expiry interval; its sessions are discarded on Clean Session only, so this applies to v5 sessions.
Gap
The expiry handler (KafkaSignalStream in MqttKafkaSessionFactory) has only the client id when the session expires. Resetting the group needs the topic partitions, the group coordinator and the delete, which the Clean Start path performs with the session's meta streams, FindCoordinator and OffsetDelete exchange.
Design questions (to settle before implementation)
Where the expiry handler obtains the partitions of the messages and retained topics.
Timing against a client that reconnects while the reset is in flight: a reset that lands after the reconnecting session has resumed and committed would discard live state. Decide how the reset is ordered with the new session, or how it is cancelled when the client reconnects.
How a failure of the exchange is handled. The Clean Start path does not retry and never fails the connect; expiry has no connect to protect.
Acceptance
Scripts and ITs first: an expiring session issues FindCoordinator and OffsetDelete for exactly the partitions it knows, and the reconnect race is pinned by a script.
The group offsets of an expired session are gone when the client reconnects.
Activity
fix(binding-mqtt-kafka): delete the group offsets of a session when i…
fix(binding-mqtt-kafka): delete the group offsets of a session when i…