When I am developing modules, I would like to not expose my actual implementation to other modules but rather just expose the interface that other modules can import and use. See the below file tree as an example of what I would like to be able to do:
com.example
-> ModuleA
-> internal
-> MyServiceImpl.kt
-> MyService.kt
This works as intended when I run my application. ModuleB can import the MyService interface and the implementation gets autowired. However the metrics counter does not work. Calls to MyService are not counted by the module.requests metric.
The workaround is to place MyServiceImpl.kt in the root of the module. When I do that the module.requests metric count cross module calls as expected. Having to publicly expose the implementation feels like unintentional behaviour and I think this should count as a bug. See file tree below for an example how to make the metric work.
com.example
-> ModuleA
-> MyServiceImpl.kt
-> MyService.kt
When I am developing modules, I would like to not expose my actual implementation to other modules but rather just expose the interface that other modules can import and use. See the below file tree as an example of what I would like to be able to do:
This works as intended when I run my application.
ModuleBcan import theMyServiceinterface and the implementation gets autowired. However the metrics counter does not work. Calls to MyService are not counted by themodule.requestsmetric.The workaround is to place
MyServiceImpl.ktin the root of the module. When I do that themodule.requestsmetric count cross module calls as expected. Having to publicly expose the implementation feels like unintentional behaviour and I think this should count as a bug. See file tree below for an example how to make the metric work.