Route to a specific microservice based on entity on path

I have a specific requirements in my project, all request with a specific set of entities



should be directed to microservice1 that manages entity1 and entity2, while



should be directed to microservice2 that manages entity5 and entity6

Is there any Kong feature that enables this kind of configuration or in alternative what is the preferred way to extend Kong to implement this behaviour?