javaspring-bootcypherjqassistant

jQAssistant analysis to find microservices and their clients


I'm following https://github.com/graphaware/fix-your-microservices to scan and identify the Micro services and their respective consumers to identify if there are any circular dependencies in my application.

The challenge in my case is the consumers may use any one of the client libraries including Github OpenFeign, Spring OpenFeign, Apache HTTP Client, OAuthRestTemplate/RestTemplate, OkHttpClient etc. I'm able to identify the Rest Controllers in my spring boot based application. That's pretty straight forward using the RestController annotations. What's challenging is to identify the client/consumers using the REST API's by the path and match them with the provider REST API's.

Each client library have a different way of invoking the services. Its fine even it means to write separate cypher queries for each of the libraries. But I'm not able to identify the relation as mentioned in the above article using INVOKES_REMOTE. What would be the approach to match the client invocation of those services using the respective URI ? I'm using jqassistant command-line 1.12.2 utility to scan multiple microservices from my source.

Thanks in advance.


Solution

  • There's no generic way of matching the client invocations to the providing service endpoints - it's highly dependent on the programming model of the client. Feign has a declarative model which makes it quite easy to provide the mapping, but there would be nearly no chance to do this if someone used Apache HTTP client constructing resource URLs by doing string concatenation. Enabling this kind of client-server interaction analysis would add requirements to the programming model used on client side, e.g. to use Feign or OpenAPI contracts. For the latter we're currently building a scanner which will be available in autumn this year.