Skip to content

MQTT5 persistent session #522

Answered by jmklix
Apapora asked this question in Q&A
Discussion options

You must be logged in to vote

Just add this to your client builder: session_behavior=mqtt5.ClientSessionBehaviorType.<what behavior you want>

You can find the API documentation here. Your code might look something like this:

    # Create MQTT5 client
    client = mqtt5_client_builder.mtls_from_path(
        endpoint=cmdData.input_endpoint,
        port=cmdData.input_port,
        cert_filepath=cmdData.input_cert,
        pri_key_filepath=cmdData.input_key,
        ca_filepath=cmdData.input_ca,
        http_proxy_options=proxy_options,
        on_publish_received=on_publish_received,
        on_lifecycle_stopped=on_lifecycle_stopped,
        on_lifecycle_connection_success=on_lifecycle_connection_success,
        on_li…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jmklix
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants