Open xiaocq2001 opened 2 months ago
I created a PR to fix the issue, please check https://github.com/bytebeamio/rumqtt/pull/854
Now broker resending the publishes:
DEBUG rumqttc::v5::state > Disconnect with NormalDisconnection
Event = Outgoing(Disconnect)
Error = MqttState(ConnectionAborted)
Incoming(ConnAck(ConnAck { session_present: true, code: Success, properties: Some(ConnAckProperties { session_expiry_interval: None, receive_max: Some(20), max_qos: None, retain_available: None, max_packet_size: None, assigned_client_identifier: None, topic_alias_max: Some(10), reason_string: None, user_properties: [], wildcard_subscription_available: None, subscription_identifiers_available: None, shared_subscription_available: None, server_keep_alive: None, response_information: None, server_reference: None, authentication_method: None, authentication_data: None }) }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 1, payload: b"\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 2, payload: b"\x01\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 3, payload: b"\x01\x01\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 4, payload: b"\x01\x01\x01\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 5, payload: b"\x01\x01\x01\x01\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 6, payload: b"\x01\x01\x01\x01\x01\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 7, payload: b"\x01\x01\x01\x01\x01\x01\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 8, payload: b"\x01\x01\x01\x01\x01\x01\x01\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 9, payload: b"\x01\x01\x01\x01\x01\x01\x01\x01\x01", properties: None }))
Incoming(Publish(Publish { dup: true, qos: AtLeastOnce, retain: false, topic: b"hello/world", pkid: 10, payload: b"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01", properties: None }))
Outgoing(PubAck(1))
Outgoing(PubAck(2))
Outgoing(PubAck(3))
Outgoing(PubAck(4))
Outgoing(PubAck(5))
Outgoing(PubAck(6))
Outgoing(PubAck(7))
Outgoing(PubAck(8))
Outgoing(PubAck(9))
Outgoing(PubAck(10))
DEBUG rumqttc::v5::state > Pingreq, last incoming packet before 5.001324026s, last outgoing request before 5.001175946s
Outgoing(PingReq)
Incoming(PingResp(PingResp))
DEBUG rumqttc::v5::state > Pingreq, last incoming packet before 5.000821551s, last outgoing request before 5.001400427s
Outgoing(PingReq)
Incoming(PingResp(PingResp))
you can use set_connect_properties
to set all kind of v5 connection properties, eg.
let mut properties = ConnectProperties::new();
properties.session_expiry_interval = Some(u32::MAX);
mqttoptions.set_connect_properties(properties);
you can use
set_connect_properties
to set all kind of v5 connection properties, eg.let mut properties = ConnectProperties::new(); properties.session_expiry_interval = Some(u32::MAX); mqttoptions.set_connect_properties(properties);
Ah currently ConnectProperties
is private, that's why I think we need an additional API, like we did for receive_maximum
, max_packet_size
and other properties.
Expected Behavior
When connecting to broker,
session_expiry_interval
should be supported.Current Behavior
There is no API to set
session_expiry_interval
for CONNECT request.Failure Information (for bugs)
Context
Failure Logs
Please include any relevant log snippets or files here.
While running example
async_manual_acks_v5
, the broker does not restore the session and re-send publishes becausesession_expiry_interval
value0xFFFFFFFF
is not offered on connection: