Justin,

I'll try to resolve the keep-alive problem.

thanks
marcos


________________________________
De: Justin Bertram <jbert...@apache.org>
Enviado: quarta-feira, 16 de abril de 2025 14:11
Para: users@activemq.apache.org <users@activemq.apache.org>
Assunto: Re: Artemis V2.38.0 - MQTT 3.1.1 - keep alive is not working

I believe what is happening is that the broker is overriding the keep-alive
set by your client since it is lower than the default. To allow the client
to set an arbitrary value set serverKeepAlive=-1 on the acceptor. See the
documentation [1] for more details.

Also, in your broker.xml for 2.38.0 you're configuring two different
acceptors with the same name and the same port, i.e.:

    <acceptor name="mqtt">tcp://
0.0.0.0:1883?protocols=MQTT;serverKeepAlive=900</acceptor>
    <acceptor name="mqtt">tcp://
0.0.0.0:1883?protocols=MQTT;connectionTTL=900000</acceptor>

The broker actually allows this (which is a bug IMO) which means the second
"mqtt" acceptor overrides the first which prevents your serverKeepAlive=900
from being used.

Lastly, I believe the broker will effectively ignore the "connectionTTL"
parameter since it doesn't follow the correct case (i.e. "connectionTtl").
Also, this setting only applies to STOMP connections so it's not relevant
here with MQTT.


Justin

[1]
https://activemq.apache.org/components/artemis/documentation/latest/mqtt.html#server-keep-alive

On Tue, Apr 15, 2025 at 6:18 PM Marcos Terada <ter...@gestal.com> wrote:

> Justin,
>
> Could you analyze ?
>
> thanks.
> marcos
>
>
>
>
>
>
>
> ------------------------------
> *De:* Marcos Terada
> *Enviadas:* Sexta-feira, 28 de Março de 2025 08:14
> *Para:* users@activemq.apache.org
> *Assunto:* RE: Artemis V2.38.0 - MQTT 3.1.1 - keep alive is not working
>
> Hi Jistin
>
> What specific "keep-alive interval" are you referring to?
> refering to:
> MQTT Version 3.1.1
> https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349238
> 3      MQTT Control Packets
>         3.1 CONNECT – Client requests a connection to a Server
>                  3.1.2.10 *Keep Alive*
>
>
>
> Is this something you're setting from your MQTT client or via the broker
> configuration? Do you have a reproducer you could share?
> Could you check if my configuration (V2.38.0) is correct? (See attached
> file.)
>
> [a] MY TEST: broker V2.38 configuration has no effect to MQTT 3.1.1 client
> keep-alive connection (always disconnects after 180 seconds).
> [b] DOUBTS: In MQTT 3.1.1, should the client configuration [3.1.2.10 Keep
> Alive] work independently of the broker configuration file?
>
>
> thanks
> marcos
>
>
>
>
> ------------------------------
> *De:* Justin Bertram
> *Enviadas:* Sexta-feira, 28 de Março de 2025 00:20
> *Para:* users@activemq.apache.org
> *Assunto:* Re: Artemis V2.38.0 - MQTT 3.1.1 - keep alive is not working
>
> What specific "keep-alive interval" are you referring to? Is this
> something you're setting from your MQTT client or via the broker
> configuration? Do you have a reproducer you could share?
>
>
> Justin
>
> On Tue, Mar 25, 2025 at 2:30 PM Marcos Terada <ter...@gestal.com> wrote:
>
> Dear Justin,
>
> I need help.
> My devices are connected to Artemis V2.19.0.
> They open a socket and do not close it [MQTT 3.1.1 QoS=0].
> The keep-alive interval is set to 900 seconds, and everything works fine.
>
> I tested an upgrade to Artemis V2.38.0 [MQTT 3.1.1 QoS=0].
> The devices have the same keep-alive setting of 900 seconds, but Artemis
> does not wait the full duration—it closes the socket after 180 seconds.
>
> Could you check if there is a bug in the keep-alive mechanism for MQTT
> 3.1.1 QoS=0 in version 2.38.0?
>
>
> Thanks,
>
>
>
>

Reply via email to