Naive implementation of MessageHandler::publish and MessageHandler::subscribe.