Based on this previous discussion:
We are using a temp queue. We publish the original message like so:
var tempQueue = mqClient.GetTempQueueName();
mqClient.Publish(queueName, new Message<StateLoginRequest>(new StateLoginRequest()
{
UserId = user.UserId,
Username = req.UserName,
Password = req.Password,
ReplyToQueue = tempQueue
}));
var response = mqClient.Get<StateLoginResponse>(tempQueue);
mqClient.Ack(response);
Passing along the temp queue. This message is received on the normal queues. and eventually a response is queued up like so:
using (var mqClient = ResolveService<IMessageService>().CreateMessageQueueClient())
{
var tempQueue = request.ReplyToQ;
var loginResponse = new StateLoginResponse()
{
Transaction = "Here is your response data"
};
var message = new Message<StateLoginResponse>(loginResponse);
mqClient.Publish(tempQueue, message);
}
I can see the temp queue being created after the GetTempQueueName() call. But when attempting to send the response over the queue, I get this error:
ServiceStack.HttpError: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text="PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'mq:tmp:63f7a0ec340842b1a4aa74b3e536efae' in vhost '/': received 'true' but current is 'false'", classId=50, methodId=10, cause= ---> RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=406, text="PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'mq:tmp:63f7a0ec340842b1a4aa74b3e536efae' in vhost '/': received 'true' but current is 'false'", classId=50, methodId=10, cause=
at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply(TimeSpan timeout)
at RabbitMQ.Client.Impl.ModelBase.QueueDeclare(String queue, Boolean passive, Boolean durable, Boolean exclusive, Boolean autoDelete, IDictionary`2 arguments)
at RabbitMQ.Client.Impl.AutorecoveringModel.QueueDeclare(String queue, Boolean durable, Boolean exclusive, Boolean autoDelete, IDictionary`2 arguments)
at ServiceStack.RabbitMq.RabbitMqExtensions.RegisterQueue(IModel channel, String queueName)
at ServiceStack.RabbitMq.RabbitMqProducer.PublishMessage(String exchange, String routingKey, IBasicProperties basicProperties, Byte[] body)
at ServiceStack.RabbitMq.RabbitMqProducer.Publish(String queueName, IMessage message, String exchange)
at LENSSX.StateHost.Services.StateAuthService.Any(InternalStateLoginResponse res) in C:\Projects\Work\LENSSX\src\LENSSX.StateHost\Services\StateAuthService.cs:line 74
at LENSSX.StateHost.Services.StateResponseService.Any(StateHostResponse hostResponse) in C:\Projects\Work\LENSSX\src\LENSSX.StateHost\Services\StateResponseService.cs:line 43
at LENSSX.StateHost.Services.StateAuthService.Any(StateLoginRequest request) in C:\Projects\Work\LENSSX\src\LENSSX.StateHost\Services\StateAuthService.cs:line 51
at ServiceStack.Host.ServiceExec`1.<>c__DisplayClass3_0.<CreateExecFn>b__0(Object service, Object request)
at ServiceStack.Host.ServiceRunner`1.<ExecuteAsync>d__13.MoveNext()
--- End of inner exception stack trace ---
It seems the original creation of the Queue creates it with durable: false, and when sending out it is using durable: true.
The only difference between the startup initialization of these systems is this line in the startup of the receiver of the StateLoginRequest system:
QueueNames.SetQueuePrefix(mqConfig.StateQueuePrefix); // This lets us have different MQ Hosts sitting in different states, listening on their own Queues.
Other than that I’m not sure why a Publish call, which is given a specific queue name (a temp queue name in this case), would change any parameters.