Unit tests on Messaging code.

Handle exceptions and timeouts in message processing.