Timestamp when queue received message

radekm Member Posts: 23


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


  • TomF
    TomF Member, Employee Posts: 406 Solace Employee
    #3 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.

  • pruffieux
    pruffieux Member Posts: 13 ✭✭

    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.

  • TomF
    TomF Member, Employee Posts: 406 Solace Employee

    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:

    1. Time of send. Set by the sending API;
    2. Time of spooling. Set by the broker;
    3. 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)

  • pruffieux
    pruffieux Member Posts: 13 ✭✭


    I understand the differences now. Would it not be a good feature to expose that Spool Time in the messaging API as this is available from SempV2 in sake of consistency?

    Thanks for your answer.