I have a requirement where the backend target URL needs to be determined based upon a feature flag check. The feature flag provider provides a java library for this. How can I customize the apigee routing to determine the target URL dynamically based upon a call out to this library?
I might do this with an External Callout. This is an Apigee-X feature that allows you to call into a remote service hosted elswhere (probably Cloud Run) and that service can be "anything". If you want to build it in Java, no problem. It needs to expose a particular GRPC interface. That service, in your case, will wrap the feature flag library, and then return the result to the API proxy.
If that sounds like a bunch of work that you would like to avoid, then you need to understand more about what the Java library for the feature flag is doing. If it's complicated, then, ...I don't see a practical way to avoid "wrapping the library" into a service.