Fixed Up Auto-Flipping Transition

bug.gif

This morning I realized that my auto-flipping of the Ticker Plants had a big hole in it. When I did the flip based on the size of the non-preferred versus preferred side queues, I wasn't properly draining the queue with messages in it. This would be a problem because the next message to arrive would appear later than all the messages in the queue, and I'd effectively drop all them. Not good.

The solution was pretty easy - make a drainPendingMessages() method that I can call before flipping the sides, and use that to drain all the pending messages, and then do the flip. This way, we don't have the gap in the message stream even though we're clearly in trouble on one side of the feed.

Much better solution.