Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change in RabbitMQ 3.7.0: Get-RabbitMQMessage missing parameter ackmode #33

Open
Spamme1 opened this issue Apr 13, 2018 · 0 comments

Comments

@Spamme1
Copy link

Spamme1 commented Apr 13, 2018

The RabbitMQ 3.7.0 has introduced a breaking change in the parameters to get messages from the queue:

rabbitmq/rabbitmq-management#68
rabbitmq/rabbitmq-management#521
rabbitmq/rabbitmq-server#1496

Invoke-RestMethod : {"error":"bad_request","reason":"[{key_missing,ackmode}]"}
At C:\Program Files\WindowsPowerShell\Modules\RabbitMQTools\1.2\Public\Get-RabbitMQMessage.ps1:131 char:13
+             $result = Invoke-RestMethod $url -Credential $Credentials ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : {"error":"bad_request","reason":"[{key_missing,ackmode}]"}
At C:\Program Files\WindowsPowerShell\Modules\RabbitMQTools\1.2\Public\Get-RabbitMQMessage.ps1:131 char:13
+             $result = Invoke-RestMethod $url -Credential $Credentials ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

This quick fix in the Get-RabbitMQMessage.ps1 is working

$body = @{
	"count" = $Count
	"requeue" = -not [bool]$Remove
	"encoding" = $Encoding
	"ackmode" = @("ack_requeue_true","ack_requeue_false")[[bool]$Remove]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant