Hey Michał,
Thanks for the info, I've been trying to get this to work but everything I do throws this error:
Could not parse JSON document: {error,
{failed_to_decode_json,
<<"{dead-letter-exchange:my-dlx}">>}}
What I find interesting about this is that there are no quotes to be found around the key/value pair while the original error with single quotes did have those.
I've tried the following commands, first just swapping the quotes, then escaping the double quotes and finally the example that's available in the documentation for dlx but everything runs into that same error. I've also tried adding spaces between the key/value pair but that doesn't help either.
rabbitmqctl set_policy --priority 0 --apply-to queues 'DLX' '.*' '{"dead-letter-exchange":"my-dlx"}'
rabbitmqctl set_policy --priority 0 --apply-to queues "DLX"
".*" "{`"dead-letter-exchange`":`"my-dlx`"}"
rabbitmqctl set_policy --priority 0 --apply-to queues "DLX" ".*" "{""dead-letter-exchange"":""my-dlx""}"
Just to be 100% sure that I didn't make a mistake somewhere I tried to use the ConvertTo-Json function in PowerShell but that one also throws that same error.
$policy = @{"dead-letter-exchange"="my-dlx"}
$policyJson = $policy | ConvertTo-Json -Compress
rabbitmqctl set_policy --priority 0 --apply-to queues "DLX" ".*" "$policyJson"
Do you have any idea how to get this working in PowerShell?
Kind regards,
Yenti