How to send message to default exchange? #91
Answered
by
Gsantomaggio
Gauthamraju31
asked this question in
Q&A
Replies: 1 comment
-
channel.Publish(
"", // default Exchange
routingKey, // queue name
false, // mandatory
false, // immediate
amqp.Publishing{
Headers: amqp.Table{},
ContentType: "text/plain",
ContentEncoding: "",
Body: []byte(body),
DeliveryMode: amqp.Transient, // 1=non-persistent, 2=persistent
Priority: 0, // 0-9
// a bunch of application/implementation-specific fields
}, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Gauthamraju31
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to send a message to the default exchange by setting the exchange name as "" (as mentioned by amqp) which is considered the AMQP Default Exchange. However I am greeted with an error as following -
[ERROR] Exchange Declare: Exception (403) Reason: "ACCESS_REFUSED - operation not permitted on the default exchange"
I have tried to call Declare exchange passive function and yet no luck. Could someone explain me how do I achieve it with appropriate properties?
Beta Was this translation helpful? Give feedback.
All reactions