Issue #21434:create and utilitize function postEvent