Repository navigation
Interop question: declaring sync/async communication contracts between application modules #1992
omphile-matheolane
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I maintain Modulith Rules, a set of ArchUnit rules for module boundaries that a few teams run alongside Spring Modulith (https://github.com/modular-monolith/modular-monolith-rules). One thing we enforce that I have not found a direct equivalent for here is a declared communication contract between two modules: ordering may talk to notifications asynchronously only, so any direct call from ordering into notifications fails the build, while reading the event type is still allowed.
Two questions. First, is there a recommended way to express that intent in Spring Modulith's module model today, so a team using both tools has one declaration rather than two? I looked at
@ApplicationModuleallowedDependenciesand the named-interface support, and it covers the "may depend" side but not the "may only depend asynchronously" side as far as I can tell. Second, if that is a gap, would a contribution that reads Spring Modulith's module metadata as the input to those contract rules be welcome, or would you rather keep the two concerns separate?Happy to put together a small example repo showing both running on the same codebase if that helps the discussion.
All reactions