[rabbitmq-discuss] how to set timestamp on basic properties

Emile Joubert emile at rabbitmq.com
Tue Jan 22 15:53:09 GMT 2013


On 22/01/13 15:27, jdepp wrote:
> I would like to set the timestamp on the message properties before adding to
> a queue but seem to get an error trying to do it. I could I guess add it to
> the header but would like to try and use the timestamp value.
>         Dim props As IBasicProperties = chan.CreateBasicProperties()
>          props.Timestamp = DateTime.Now.ToString

The timestamp property in AMQP 0-9-1 is defined as a 64bit Unix
timestamp, which is seconds since 1970/1/1, instead of a string. Also
note the comments in the AmqpTimestamp class.

As you say, if consumers and producers both agree on a string date
format and you don't care about interoperability then you can include a
data string as a header instead of the property.


More information about the rabbitmq-discuss mailing list