pardahlman / RawRabbit

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

Setting x-max-length of queue #287

Closed Towmeykaw closed 6 years ago

Towmeykaw commented 6 years ago

Hello! Im having issues setting the x-max-length argument of a queue. Im using the following to get messages form an exchange but i cant set a max value of the queue that gets created. .UseSubscribeConfiguration(cfg => cfg .OnDeclaredExchange(e => e .WithName("bus2center") .WithType(ExchangeType.Topic)) .Consume(c => c .WithRoutingKey("*.tracking.position"))

pardahlman commented 6 years ago

Hello @Towmeykaw ,

Have you tried using the WithArgument configuration

.FromDeclaredQueue(q => q
    .WithName("custom_queue")
    .WithAutoDelete()
    .WithArgument("x-max-length", 10))
Towmeykaw commented 6 years ago

I was pretty sure i had tried that. But it worked perfectly! Thanks! 👍