locked
Message Broker RabbitMQ Consumer Related Doubt !! RRS feed

  • Question

  • User-2121988648 posted

    Hi,

    Suppose, I have 2 microservices. I am Producing Message (Sending) to RabbitMQ from Microservice 1.

    Now, in which layer should I place my Consuming related Code in Microservice 2, it uses Received Event of Consumer. What should be the code organization/folder structure for all the Consumers in entire Microservice 2.   

    Also, How to make it maintainable for When consuming from Multiple Microservices to Microservice 2.  

    Sunday, August 16, 2020 3:17 PM

All replies

  • User-474980206 posted

    the compiler does not care how the folders are structured. pick a scheme you like. I assume there will be a queue per consumer. 

    you have several options:

     /messagemodels
        /service1
        /service2
      /services
         /service1
         /service2
      /common

    or 

    /service1
        /messagemodels
        /handler
    /service2
        /messagemodels
        /handler
    /common

    Monday, August 17, 2020 3:21 PM
  • User-2121988648 posted

    Hi Bruce,

    Thank you for replying. Can you please help me understand the significance of each folder. What design-pattern needs to be considered. Other specific details ?

    Monday, August 17, 2020 3:37 PM