You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Andreas Hubert (Jira)" <ji...@apache.org> on 2021/05/27 12:09:00 UTC
[jira] [Created] (ARTEMIS-3319) Message Timestamps not set for MQTT
Andreas Hubert created ARTEMIS-3319:
---------------------------------------
Summary: Message Timestamps not set for MQTT
Key: ARTEMIS-3319
URL: https://issues.apache.org/jira/browse/ARTEMIS-3319
Project: ActiveMQ Artemis
Issue Type: Bug
Components: MQTT
Affects Versions: 2.17.0, 2.16.0
Environment: Apache Artemis 2.16.0 and 2.17.0 (via docker).
Clients used for testing:
* mosquitto_sub with "-C" (aka clean session flag false)
* mosquitto_pub
Reporter: Andreas Hubert
Messages coming in via MQTT always have timestamp 0 (which shows as 1970-01-01 01:00:00 in the management console when browsing queues of MQTT clients).
As quick search inside the *artemis-protocols* folder of the source code shows that the method call *setTimestamp* appears in the CORE, AMQP and STOMP protocols, but not inside the MQTT protocol source:
{code:java}
grep -r setTimestamp | grep -v '^tests\|/test/'{code}
It seems there should be a call to *message.setTimestamp(System.currentTimeMillis())* inside *MQTTUtil.createServerMessage()*.
Also, although *expiry-delay* has been set to 120000 in the address-settings, the *Timestamp* and *Expires* values for MQTT messages are exactly the same, so a call to *setExpiration* or *setJMSExpiration* may be missing too (but maybe it is just a consequence of the missing timestamp).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)