pardahlman / RawRabbit

A modern .NET framework for communication over RabbitMq
MIT License
747 stars 144 forks source link

Question about Direct Reply with RPC #278

Closed cocowalla closed 7 years ago

cocowalla commented 7 years ago

I was reading on on how Direct Reply works, and it says you should publish to the default exchange (""), and consume from a pseudo queue, amq.rabbitmq.reply-to.

However, when running RPC (ResquestAsync & RespondAsync) with RawRabbit I can see in RequestConfigurationFactory that it the request configuration uses an exchange named according to the RawRabbit naming conventions, e.g. "my_app".

When watching in the RabbitMQ management GUI, I can indeed see messages flowing through this exchange, and also being queued from a queue named according to the RawRabbit naming conventions, e.g. "my_message_type".

Is this the expected behaviour?

pardahlman commented 7 years ago

Hello hi 👋 ,

If you are performing an RPC without any configuration there will be a request message and a response message. The request message is like any other message, it gets routed using naming strategies etc. It is the response message that is published to the "pseudo queue". To achieve this, the client sneding the request is consuming from the "pseudo queue" and the responding party publishes a response on / that is routed to the "pseudo queue".

cocowalla commented 7 years ago

Aaah, it makes sense now!

Thanks for the helpful explanation.