Timestamp when queue received message
Hi,
does Solace durable queue store a timestamp when it received a message or can we configure it to do so?
I tried InboundMessage.getTimeStamp
and it always returns 0.
I also tried InboundMessage.getSenderTimestamp
and it's always null
because I'm not filling it in the sender.
According to an older question https://solace.community/discussion/132/getting-solace-brokers-message-receipt-timestamp it seems that for performance reasons Solace broker doesn't generate timestamps?
Thanks for the answers
Best Answer
-
Hi @radekm, yes, we don't send receipt timestamps on messages. You can, however, query the spooled time timestamp on a given queue.
In PubSub+ Broker Manager, navigate to the queue, select "Messages Queued" and you'll see a "Spooled Time" column. You can also query this using SEMP, using https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/monitor/index.html#/queue/getMsgVpnQueueMsg. You'll need to know the ID of the message you want the timestamp for (or iterate through them all). The response has a "spooledTime" field.
1
Answers
-
Hi @radekm, yes, we don't send receipt timestamps on messages. You can, however, query the spooled time timestamp on a given queue.
In PubSub+ Broker Manager, navigate to the queue, select "Messages Queued" and you'll see a "Spooled Time" column. You can also query this using SEMP, using https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/monitor/index.html#/queue/getMsgVpnQueueMsg. You'll need to know the ID of the message you want the timestamp for (or iterate through them all). The response has a "spooledTime" field.
1 -
Why did you not map the receiveTimestamp in the Java / JCSMP API's with this spooled Time ?
It's a bit weird to make an extra call to the SEMP API just to get the timestamp.
This is confirm that for browsing the best approach would be to query through SEMP API for all metadata and then using the messaging API just to get the content (body) of the message.
0 -
The receive timestamp is the time the API received the message. That's different to when the message was spooled, as the consumer could have been offline.
There are 3 possible times of interest here:
- Time of send. Set by the sending API;
- Time of spooling. Set by the broker;
- Time of receive. Set by the receiving API.
To get this receive timestamp, you'll need to set the generate receive timestamps session property (GENERATE_RCV_TIMESTAMPS in JCSMPProperties)
1