Skip to content

Apply AutoDelete only for exchange but not queue #5189

Closed Answered by s-horbach
s-horbach asked this question in Q&A
Discussion options

You must be logged in to vote

i managed to solve the issue by replacing
receiveEndpointConfig.SetQueueArgument("x-expires", TimeSpan.FromSeconds(5));
with
receiveEndpointConfig.QueueExpiration = TimeSpan.FromSeconds(5);

both lines eventually do the same, that is add "x-expires" argument to the queue but afaik there is a subtle difference:

  • when i set AutoDelete = true that applies it to both exchange and queue (of the same MT endpoint)
  • then i set QueueExpiration, which basically discards AutoDelete for a queue but still keeps it for exchange

ℹ️ this is only my assumption based on the piece of code i found in MT:

var queueAutoDelete = settings.AutoDelete;
if (settings.QueueExpiration.HasValue)
{
    queueArguments["x-…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by s-horbach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant