Boiler plate code for doing a queue message handler with generic message types.