It depends on the nature of the topic: if the topic is durable (it has reliable consumers who subscribe to it), the broker will keep messages in the subject until all strong consumers spend messages. if the topic is not durable (there are no reliable consumers), the message will not even be sent on this topic, as there will be a long subscription.
In your example, I will assume that you are using reliable subscriptions / consumers: Case 1:
- T-2 C1 and C2 provide a long-term theme subscription
- Disabling T-1 C1 and C2
- T0: M0 sent
- T1: M1 sent
- T2: C1 connects. C1 gets M0 and M1
- T3: M3 sent. C1 gets M3
- T4: M4 sent. C1 gets M4
- T5: C2 connects, C2 gets M0, M1, M2, M3, M4
, /: , , . , ( / ).
, , .
:
- T-2 C1 C2
- T-1 C1 C2
- T0: M0
- T1: M1
- T2: C1 . C1
- T3: M3 . C1 M3
- T4: M4 . C1 M4
- T5: C2 , C2