components-contrib
components-contrib copied to clipboard
Possibility to publish messages to a specific RoutingKey
Hello all,
I am looking for a way to publish a message to RabbitMQ using a RoutingKey. With the help of PublishEventAsync() I can assign the message to the topic, but only without RoutingKey. Is there any possibility?
Also, when I automatically create the exchange in RabbitMQ, the type is always set to 'fanout', even if I have set the exchangeKind to 'topic'.
Thank you in advance, BR Daniel
Please check the document
Thanks for the answer, but I think I need to describe my problem more in detail:
My problem is that I am not creating a subscription via another Dapr client. Following scenario: An application implements a listener on the exchange 'cadcam...machine.changed.v1'. The exchange is automatically created in my RabbitMQ of type 'topic' and a queue is automatically generated which binds to the exchange .
If I now want to send a message to the exchange via the Dapr client, I get the error message that the preconditions are not met, because a topic of the type 'fanout' is expected.
"Exception (406) Reason: PRECONDITION_FAILED - inequivalent arg 'type' for exchange xy received 'fanout' but current is 'topic'"
The question for me is how to send the message to an exchange of type 'topic'? However, if I first send a message via the Dapr client and the exchange is generated autmoatically of type 'fanout', then I can start my listener afterwards (which automatically changes the type to 'topic'), and it works.
Thank you in advance. BR Daniel
There should be clear settings in the documents provide.
for example
exchangeKind: topic
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.
In case anyone should ever have the same problem: The error was due to an old daprd version (1.6.0). With a more recent version (>= 1.7.4) it works as desired. BR Daniel