bastiat
bastiat

Reputation: 2071

Bind rabbitmq default exchange to other exchange

Is it possible to bind rabbitMq default exchange to other exchange?

I would like to forward messages from my bar exchange to default exchange, but I don't know how.

For two custom exchanges - foo and bar it works fine:

    @Bean
    Binding fooExchangeToBarExchange(FanoutExchange fooExchange, FanoutExchange barExchange) {
        return BindingBuilder.bind(fooExchange).to(barExchange);
    }

but similar with default exchange doesn't work

    @Bean
    DirectExchange defaultExchange() {
        return new DirectExchange("");
    }

    @Bean
    Binding defaultExchangeToBarExchange(DirectExchange defaultExchange, FanoutExchange barExchange) {
        return BindingBuilder.bind(defaultExchange).to(barExchange);
    }

Upvotes: 0

Views: 663

Answers (1)

Gary Russell
Gary Russell

Reputation: 174799

No it is not allowed:

Shutdown Signal: channel error; protocol method: #method<channel.close>(reply-code=403, reply-text=ACCESS_REFUSED - operation not permitted on the default exchange, class-id=40, method-id=30)

Upvotes: 1

Related Questions