Can you please give your recommendations about sharing contracts between publisher and subsciber in mircroservices oriented architecture when using MassTransit as service bus? Would it be better to have a separate nuget package for this or have a copy of contract in each microservice?
Asked
Active
Viewed 637 times
2
-
1Both approaches are valid. It is important to version your contracts though. – Alexey Zimarev Aug 28 '18 at 15:52
-
According to reply at [this](https://stackoverflow.com/questions/51626266/does-masstransit-request-response-need-common-dlls-in-microservice-architectur) post contract in producer side should have the same namespace as contract in cosumer. Isn't that mean that shared contract is a preffered way? – Александр Сысоев Aug 29 '18 at 08:24
-
1You have to keep the namespace but sharing binaries is more cumbersome than copy-pasting code. It also potentially brings too many message contracts to the other side than it needs. I'd start by copying code (it must include namespaces) and if there will be too many copy-pastes - consider using nuget packages. – Alexey Zimarev Aug 29 '18 at 08:37