Imaginative setup
- Several services
- Each lives in its own repository
- Each developed separately
- Each deployed separately
- They want to communicate via NServiceBus
Research
Examples on NServiceBus basics show how several applications, which are part of the same solution, share message definitions using another Shared library project, that they all reference. Here, if services are not part of the same solution things become complicated.
I suppose, shared project can be extracted into a separate repository and then be referenced from other repositories as a DLL or as a custom NuGet package, for example. But it creates a lot of difficulties during development and doesn't feel to be right.
In this sample http://docs.particular.net/samples/step-by-step/, there is even a note saying:
Storing all message definitions in a single location is not a best practice, but serves to illustrate how things work for this simple example.
However I yet failed to find what is a best practice.
Question: How to share message definitions between services in a proper way?