Issue #8395 by tuj: Added publish/unpublish to middleware communication.