Use case scenario of durable listeners/consumers

后端 未结 1 1232
执笔经年
执笔经年 2021-01-28 18:41

So I am creating concurrent consumers to a topic i.e. multiple listeners. I am configuring them to be durable.

@Bean
public DefaultMessageListenerContainer list         


        
1条回答
  •  囚心锁ツ
    2021-01-28 19:11

    That is correct; topic subscriptions are not durable by default; only subscribers actively consuming get messages. New consumers only get new messages published while subscribed.

    A durable consumer acts more like a queue; the broker keeps track of them and keeps messages around until all such consumers have received them.

    The subscription only becomes durable when it is established. If the broker doesn't know about it, messages won't be retained. Hence it's important to establish your durable subscriptions before publishing any messages.

    0 讨论(0)
提交回复
热议问题