LDonSOvrfw
LDonSOvrfw

Reputation: 49

Is not possible to set RabbitMQ policy on Windows Server

I want to set expiration for RabbitMQ message queues.

When I am trying do it with command:

rabbitmqctl.bat set_policy expiry ".*" "{""expires"":432000000}" --apply-to queues

I am getting this error:

Error:
Could not parse JSON document: {error,
                                   {failed_to_decode_json,
                                       <<"{expires:432000000}">>}}

althought I act in accordance with documentation the documentation:

https://www.rabbitmq.com/docs/ttl#queue-ttl-using-policy

Operating system is Windows Server.

Presently I can see that this option is functional for me:

PS C:\scripts> rabbitmqctl.bat set_policy 'expiry' '.*' '{\"expires\":432000000}' --apply-to queues
Setting policy "expiry" for pattern ".*" to "{"expires":432000000}" with priority "0" for vhost "/" ...
PS C:\scripts>

With backslash before quotation mark.

Upvotes: 0

Views: 37

Answers (0)

Related Questions