Skip to content

Commit

Permalink
Do not attempt to redeclare tmp quue's which are declared exclusive.
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Nov 5, 2014
1 parent 8e47be0 commit 5ddf12b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/ServiceStack.RabbitMq/RabbitMqExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ public static bool IsServerNamedQueue(this string queueName)
throw new ArgumentNullException("queueName");
}

return queueName.ToLower().StartsWith("amq.");
var lowerCaseQueue = queueName.ToLower();
return lowerCaseQueue.StartsWith("amq.")
|| lowerCaseQueue.StartsWith(QueueNames.TempMqPrefix);
}

public static void PopulateFromMessage(this IBasicProperties props, IMessage message)
Expand Down
3 changes: 2 additions & 1 deletion src/ServiceStack.RabbitMq/RabbitMqProducer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public void PublishMessage(string exchange, string routingKey, IBasicProperties
{
try
{
// In case of server named queues (client declared queue with channel.declare()), assume queue already exists (redeclaration would result in error anyway since queue was marked as exclusive) and publish to default exchange
// In case of server named queues (client declared queue with channel.declare()), assume queue already exists
//(redeclaration would result in error anyway since queue was marked as exclusive) and publish to default exchange
if (routingKey.IsServerNamedQueue())
{
Channel.BasicPublish("", routingKey, basicProperties, body);
Expand Down

0 comments on commit 5ddf12b

Please sign in to comment.