Closed schneidr closed 6 years ago
I think using the -IncludeEnvelope parameter (with either method) will give you an object that includes the headers (including properties.reply_to and properties.reply_to_address) which should give you what you need to craft the response (using Send-RabbitMqMessage).
Thanks, that was the key.
For completeness, when somebody runs into the same problem, this is how I got it working:
$data = Wait-RabbitMqMessage -Exchange $ExchangeName -QueueName $QueueName -Key $QueueName `
-Timeout 120 -IncludeEnvelope @Params -ErrorAction SilentlyContinue
$return = @{
result = 'ok'
}
# do whatever you want with $data.payload, store your result in $return
Send-RabbitMqMessage -ReplyTo $data.properties.reply_to -Key $data.properties.reply_to -DeliveryMode 2 `
-CorrelationID $data.properties.correlation_id -ContentType 'application/json' `
@Params -InputObject $return
I'm implementing RPC via direct reply-to messages. The PHP part that sends a request works, I get the request in PowerShell, but I find nothing on how to send back an acknowledgement.
working variant 1:
working variant 2:
Both variants print out the message. But all I get is a string ... how do I send a response?