Hugo
Hugo

Reputation: 65

How to use fanout exchange in rabbitmq-c?

I am testing c client in rabbitmq in centos 5.5. If I want to use the fanout exchange to push messages to every queues, how should set the parameter routingkey?

The function amqp_basic_publish is shown below:

 amqp_basic_publish(amqp_connection_state_t state,
                   amqp_channel_t channel,
                   amqp_bytes_t exchange,
                   amqp_bytes_t routing_key,
                   amqp_boolean_t mandatory,
                   amqp_boolean_t immediate,
                   amqp_basic_properties_t const *properties,
                   amqp_bytes_t body)

Is the parameter routing_key meaningless when using the fanout exchange? If so, what value should I set this parameter to?
Thanks for any useful suggestions!

Upvotes: 0

Views: 533

Answers (1)

kzhen
kzhen

Reputation: 3118

The routing key does nothing and can be set to anything when you have a Fanout exchange.

Take a look here for a really good summary of the different exchange types.

Upvotes: 1

Related Questions