title: Sharing code between Micro-services - is it justified in this situation?
body: <p>There are so many answers and blog posts saying "never share code between microservices" and I wonder right now how I am supposed to follow that advice. I've got the following microservices and each of them is communicating via RabbitMQ:</p>
  
  <p><a href="https://i.stack.imgur.com/0Agof.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Agof.png" alt="enter image description here"></a></p>
  
  <p>The express server and the two different background services have completely different code, while the request workers are just multiple instances. Each request worker is supposed to process a request and return a direct reply to it once it is done with it (RPC).</p>
  
  <p><strong>My question:</strong></p>
  
  <p>I have written a class (<code>RequestScheduler</code>) which offers methods to schedule a request (e. g. <code>getProfile: Promise&lt;IProfile&gt;</code>). Since I am apparently not allowed to share code between microservices what about the code for the communication between the microservices?</p>
  
  <p>I don't see a way how I could avoid sharing that code along with my microservices on the left side.</p>