Skip to content

MQTT: Configure quiesceTimeout in disconnectForcibly() #10095

Open
@artembilan

Description

@artembilan

Discussed in #10093

Originally posted by leonard2901 June 10, 2025
Hello,
I use spring-integration-mqtt (phao3) to communicate with a Mosquitto instance. For integration testing, I start Mosquitto using Testcontainers.

This generally works fine, but the tests encounter a 30-second timeout when the client attempts to disconnect, as the container has already been stopped. I have looked through the code, especially the doStop() method in MqttPahoMessageDrivenChannelAdapter. There this.client.disconnectForcibly(getDisconnectCompletionTimeout()); is called. In this overload the default QUIESCE_TIMEOUT of 30 seconds is used.

In my tests I would like to just disconnect immediately and discard any potentially pending messages.

Is there a way to configure the quiesceTimeout or any other way to disconnect without a timeout?

Any help is appreciated! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions