Fixed threading issue when multiple threads do polling
Improved the example application and message processor a bit