Open BeePM opened 6 years ago
@BeePM I think you have to take a step back as I think you're making a mistake when it comes to DDD.
IMHO, you should not be sending domain objects across network boundaries to other microservices. You should encapsulate your domain objects and keep them within your bounded context (your microservice). I would recommend instead that you create contracts that are specifically used for messaging and map from your domain aggregates to those message contracts.
This will ensure that your internal domain models can evolve without breaking the message contract with other services.
Hello @BeePM,
If you want to troubleshoot this, I would suggest looking at the RabbitMQ management tool and see if the message is published at all. Here the RawRabbit logs can be useful, too. I'm guessing that there could be some sort of serialization problem.
Once you have verified that the message is published, you could check the logs on the subscriber and see if there are any exceptions there. You could also create a custom queue that receives the payload and copy the json and check if it deserializes to the target type on the subscriber side.
Hi guys,
I developed a microservice architecture based project and the main communication tool between microservices is RabbitMQ. I'm using RawRabbit library to handle all communication logic.
Everything is working as expected and pretty fast, however, I've encountered a couple of things that I found really weird and I would like to discuss it here, because maybe I'm doing something wrong.
The problem is with complex objects. When I'm sending, receiving classes with primitive types inside, everything is ok, however, the fun starts here:
This is my domain class, which I would like to receive from another microservice via RabbitMQ, but for some reason I'm not able to receive anything. I tried to modify this class and I left only primitive types + strings and everything worked.
I also had a similar problem with my Logging service. I introduced a logging system based on RabbitMQ by sending Log commands over the network and I had a class for that like:
So the problem was, when I created LogCommand and I set the Message property and then ran _bus.PublishAsync, rabbit was able to send it over the network, however, when I set Parameters property and then ran _bus.PublishAsync, the message never arrives anywhere.
Any thoughts?