There are so many answers and blogposts that say, “Never exchange codes between microservices,” and I'm wondering how I should follow this advice. I have the following microservices, and each of them reports through RabbitMQ:

The express server and two different background services have completely different code, and work requests are just a few instances. Each request handler must process the request and return a direct response after it has been completed (RPC).
My question is:
I wrote a class ( RequestScheduler) that offers methods for scheduling a request (for example, getProfile: Promise<IProfile>). Since I'm apparently not allowed to pass code between microservices, what about code for communication between microservices?
, .