I am trying to write some generic code that can handle different types of input messages, apply some workflow logic and calls the callback for each messages.