Is timestamp now required on each metric?

After upgrading to 4.0.25 I got these error messages:

SparkplugMessageRunnable	Failed to handle Sparkplug B message on topic spBv1.0/Sparkplug Devices/DDATA/XXXX Edge Node/XXXX
com.cirruslink.common.util.exception.CirrusException: INVALID_ARGUMENT

at com.cirruslink.mqtt.engine.gateway.sparkplug.SparkplugPayloadHandler.handlePayload(SparkplugPayloadHandler.java:234)

at com.cirruslink.mqtt.engine.gateway.sparkplug.SparkplugMessageRunnable.run(SparkplugMessageRunnable.java:72)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)

Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Date.getTime()" because the return value of "org.eclipse.tahu.message.model.Metric.getTimestamp()" is null

at com.cirruslink.mqtt.engine.gateway.sparkplug.SparkplugBPayloadHandler.handleDeviceData(SparkplugBPayloadHandler.java:1824)

at com.cirruslink.mqtt.engine.gateway.sparkplug.SparkplugPayloadHandler.handlePayload(SparkplugPayloadHandler.java:220)

... 4 common frames omitted

The protobuf schema from the SparkplugB specification shows the timestamp under Metric is optional.

This actually is required on page 68 of the spec (https://www.eclipse.org/tahu/spec/sparkplug_spec.pdf):

[tck-id-payloads-name-birth-data-requirement] The timestamp MUST be included with
every metric in all NBIRTH, DBIRTH, NDATA, and DDATA messages.

1 Like

Thanks for the link and clarification. I have been living in a cave and was not aware when version 3.0 came out.