The following code fragment checks for and extracts the message timestamp from a received message.
try:
msg = receiver.fetch(timeout=1)
if "x-amqp-0-10.timestamp" in msg.properties:
print("Timestamp=%s" % str(msg.properties["x-amqp-0-10.timestamp"]))
except Empty:
pass
try:
msg = receiver.fetch(timeout=1)
if "x-amqp-0-10.timestamp" in msg.properties:
print("Timestamp=%s" % str(msg.properties["x-amqp-0-10.timestamp"]))
except Empty:
pass
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow