Define message type and event observer