When to use direct exchange over fanout exchange

后端 未结 3 975
醉话见心
醉话见心 2021-02-13 08:43

As far as I can tell, there is no proper use case for a direct exchange, as anything you can do with it you can do with a fanout exchange, only more expandably.

More spec

3条回答
  •  逝去的感伤
    2021-02-13 09:44

    Do you mean a fanout exchange or a topic exchange? a fanout exchange is very different from a direct exchange. I presume that sending the photo to the exchange is sent with a routing key that specifies that there is a photo. In which case you have a consumer that generates the thumbnail and when you want to add a new consumer you can just add it and get the same message but do something different with it, ie award points.

    The use case holds up. I think the point is that the exchange is originally created as a direct exchange.

提交回复
热议问题