We added standard headers to the tcp adapters (sequence number) that allow resequencing, but that is only reliable because tcp guarantees packet arrival order. With TCP we might need resequencing if we are using NIO and, although the packets arrive in order, they might be dispatched to the channel out of order. As you say, with UDP, the packets can arrive out of order so assigning sequence numbers on the server side is meaningless.
This means, for UDP, you need to put a sequence number in the payload on the sending side; on the receiving side, you can copy the value from the payload into the sequenceNumber header; you can then use a standard resequencer to resequence the packets.
However, as well as the possibility of packets arriving out of order, UDP doesn't guarantee packet arrival at all; if you have missing packets, a resequencer won't help you because it will wait for the missing packet(s).
The bottom line is, if you want to guarantee arrival and sequence, you should be using TCP, not UDP.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware