Count the number of messages processed
Handle the situation where we insert duplicates (should not happen, but hey...)