2

When using the Request/Response messaging pattern within EasyNetQ I need to declare a private response queue (with a specific name) before sending the message on the request queue?

I presume the framework declares the response queue in the background but how can I give this response queue a specific name?

I don't see any information on this within the documentation at https://github.com/EasyNetQ/EasyNetQ/wiki/Request-Response

gerard
  • 835
  • 11
  • 27

2 Answers2

1

This is the default implementation of the naming conventions: https://github.com/EasyNetQ/EasyNetQ/blob/develop/Source/EasyNetQ/Conventions.cs

So perhaps you can try something like this:

bus.Advanced.Conventions.RpcReturnQueueNamingConvention = () => "MyReturnQueue";
Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68
0

In the lastest EasyNetQ ,bus.Advanced.Conventions.RpcReturnQueueNamingConvention is readonly, can't be set

Maybe you can set queue name when using the RPC method like

bus.Rpc.Respond<RequestMsg, RepsonseMsg>(request => {//...},x=>x.WithQueueName("your queue name"));

or

var msg = bus.Rpc.Request<RequestMsg, RepsonseMsg>(request, x => x.WithQueueName("your queue name"));
deng jie
  • 1
  • 1