2512396 Refactor consume and process_message

Authored and Committed by cqi 4 years ago
    Refactor consume and process_message
    
    A new method _map_message is added for converting a message object to
    corresponding event handler and module build. This is used to shorten the
    process_message method.
    
    process_message is refactored so that:
    
    * when handler is NO_OP, just return as earlier as possible because setting it
      make no sense to set MBSConsumer.current_module_build_id back and forth.
    * Re-raise error thrown from handler execution so that the caller is able to
      get a chance to collect monitoring metric inside except clause handling
      Exception. Otherwise, no failed metric is collected. This is the major
      problem this patch is to fix.
    * Ensure MBSConsumer.current_module_build_id is set back to None.
    
    In consumer method, no traceback is logged inside except clause catching
    Exception. process_method does that.
    
    Signed-off-by: Chenxiong Qi <cqi@redhat.com>