this doesn't seem really correct. If there is no metadata configured (so the document is not "auto routable"), it'll throw an exception. Maybe something like this is better:
````php
try {
    $this->getMetadataFactory()->getMetadataForClass(get_class($document));
} catch (ClassNotMappedException $e) {
    return false;
}

return true;
````