[rabbitmq-discuss] [amqp-dev] OT Leap Seconds and RFID?

Alexis Richardson alexis.richardson at cohesiveft.com
Fri Jan 2 19:36:40 GMT 2009


Bob

On Thu, Jan 1, 2009 at 2:46 PM, Bob Paddock <bpaddock at softwaresafety.net> wrote:
>
> I had two questions I thought someone might have an answer to here.

Hi there and happy 2009.  I hope your mp3 player was not a Zune.

> Directly, does anyone know of where AMQP is being used for Middleware in RFID
> applications?

Re RFID, I am cross-posting this to the RabbitMQ list.  I do not
personally know of anyone using AMQP for RFID.  Some AMQP proponents
are in the business of managing sensor networks and they may jump in
and comment.  Of course the incumbent MOM standard in this niche is
arguably MQTT from IBM -- http://mqtt.org/

> Off-topically (?), my curiosity is getting the better of me.  I was wondering
> how Leap Seconds are dealt with in the layers above AMQP?
>
> Last night there was a Leap Second, so a compliant clock,
> http://tf.nist.gov/general/pdf/1976.pdf page 27 , would tick from 23:59:59
> to 23:59:60, then to 00:00:00.
>
> AMQP uses 64 bit POSIX time_t format, that does not deal with Leap Seconds.
> It would have two 23:59:59 events in a row.  What would happen to a stock
> trade for the same shares executed at both events by different entities?
> I'm making the naive assumption the first trade in the que wins?

I can half answer your question about timing, at least the example
about stock trades.  This would be handled by application semantics
and not by AMQP.

* Different trading applications would have their own strategies for
filling orders with the same time stamp, for example if it is possible
to split the trade between two parties, then each may get a half fill
if that is permissible.  Or, the fill may be 'all or none' and
determined at random between the two competing orders.  Obviously AMQP
cannot take a view on such matters, and consequently does not.

* In the case where application behaviour depends on event ordering,
AMQP does not order events by time, only by logical order.  So your
question would become: when are two events ordered within AMQP and how
should an application deal with this?  The answer then depends on
factors such as whether you have more than one queue, since two events
on two queues, in the absence of global total order, are of course
logically concurrent.

* There are notions of time when AMQP talks about a timeout, but these
are relative and not absolute.  Two clocks, one counting the leap
second, and one not counting it, can still agree on how long an
interval is, provided it is expressible in whole seconds.

Hope this helps :-)


> Something to be considered in the future might be an option of libtai to
> mitigate the double :59 problem:
>
> libtai supports two time scales: (1) TAI64, covering a few hundred billion
> years with 1-second precision; (2) TAI64NA, covering the same period with
> 1-attosecond precision. Both scales are defined in terms of TAI, the current
> international real time standard.  Does support leap seconds, at least
> when the table is updated.  http://cr.yp.to/libtai.html

How is this handled in other protocols for example TCP, SCTP, HTTP and XMPP?

alexis richardson,
RabbitMQ



>
> --
>                http://www.wearablesmartsensors.com/
>  http://www.softwaresafety.net/ http://www.designer-iii.com/
>                 http://www.unusualresearch.com/
> _______________________________________________
> amqp-dev mailing list
> amqp-dev at lists.amqp.org
> http://lists.amqp.org/mailman/listinfo/amqp-dev
>




More information about the rabbitmq-discuss mailing list