JT Moree wrote: > Hanno Hecker wrote: >>> Is there a message ID that is unique to each message? >> Not until the sending client has submitted a 'Message-ID' header ;-) > >> But it would be easy to add / generate a transaction id after every >> reset_transaction() call. This could be logged instead of (or as >> addition to) the PID. > >> + $self->{_transaction_id} = sprintf("%08X", rand(2**32 - 1));
I calculate transaction ids like this (hires time): my $mid = sprintf("%.4f%d", time(), $self->{_id}); $self->{_id} is the id of the server and currently calculated by using the last digit of the IP address. This allows transaction ids to be unique across 10 servers. When servers get fast enough this may end up causing dup ids. A scheme like this allows easy auditing of problems because the id contains the "when and where". Cheers, ds > > Is this uique enough? what is the chance of getting the same random > number again? should it be a combination of the PID + time + rand?