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

Adding queue binding with argument/header #30

Open
disgustipated opened this issue Dec 6, 2017 · 0 comments
Open

Adding queue binding with argument/header #30

disgustipated opened this issue Dec 6, 2017 · 0 comments

Comments

@disgustipated
Copy link

I'm having trouble trying to add an argument to a queue binding using Add-RabbitMQQueueBinding. I'm getting "Parameter set cannot be resolved using the specified named parameters". I believe it has something to do with the -Headers. I was looking at the add-rabbitmqqueue.ps1 and it looks like its slightly different than how the header is set up. I tried to add that to my add-rabbitmqqueuebinding.psq and it didnt work either. Example of what I'm trying to do below:

$queueNamesIn = ('apple','orange')
$i=0
$queuesArray=@()
foreach($item in $queueNamesIn){
    $i++
    $queueEntry = ("defaultqueue" + $i)
    $queueEntry = New-Object System.Object
    $queueEntry | Add-Member -type NoteProperty -name Name -Value $item
    $queuesArray += $queueEntry
}
foreach($queueItem in $queuesArray){
    Add-RabbitMQQueue @rabbitparams -name $queueItem.Name -Durable -VirtualHost /
    Add-RabbitMQQueueBinding @rabbitparams -ExchangeName 'interface-exchange' -Name $queueItem.Name -VirtualHost / -RoutingKey ($queueItem.Name + ".#")
    Add-RabbitMQQueue @rabbitparams -name ($queueItem.Name + "-error") -Durable -VirtualHost /
    $scriptName = ("""" + $queueItem.Name + " Script""")
    Add-RabbitMQQueueBinding @rabbitparams -ExchangeName 'error-exchange' -Name ($queueItem.Name + "-error") -VirtualHost / -RoutingKey ($queueItem.Name + "-error.#") -Headers @{'script-interface'=$scriptName }
}
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