using
(var connection = connectionFactory.CreateConnection())
{
using (var model = connection.CreateModel())
{
model.ExchangeDeclarePassive(
CommonService.ExcahangeName);
QueueDeclareOk ok = model.QueueDeclarePassive(CommonService.SerialisationQueueName);
if(ok.MessageCount > 0)
// Bind the queue to the exchange
model.QueueBind(
CommonService.SerialisationQueueName, CommonService.ExcahangeName, string.Empty);
// Set up message properties
var properties = model.CreateBasicProperties();
// Messages are persistent and will survive a server restart
properties.DeliveryMode = 2;
PublishMessages(model, properties, custList);
model.Close();
}
}
I don't know if this counts as "broken" but this is how the protocol is supposed to work. I'm also not
sure how else it would work with client-defined entities ("last write wins" can be more confusing).
I'm not sure we'd be interested in explaining this for every *.declare method in every client
but a doc guide on queue and exchange properties is a good idea.