I am not sure what happens in the below scenarios, it would be of great help if someone explains it.
Producer (P) sends messages M1, M2 , M3 , M4 , M5, M6 , M7; assuming it is sent from time T1 to T7.
Assume ActiveMQ is used as the JMS Provider (AMQ)
Message Consumer (L) will be a listener bound to the topic. Topic Name : jmsTopic
Scenario 1 :
AMQ is running, L is not connected to jmsTopic in AMQ. P sends M1 to M7 to jmsTopic. If L is connected to jmsTopic at time say T8 which is greater than T7, will it receive the messages M1 to M7 or only messages that are sent to the topic after time T8.
Scenario 2: AMQ is running, L is connected and listening to jmsTopic, P sends M1 to M4. L receives M1 to M4. In the meantime L processes M1 to M4, P sends M5 to M7, however L crashes out during processing of M4. If L again connects itself to jmsTopic , does it receive M5 to M7 or only messages that were sent after L has connected to jmsTopic will be received by L.
Scenario 3: AMQ is running, L is connected and listening to jmsTopic, P sends M1 to M7. However AMQ crashes; is L aware of AMQ status and reconnects once AMQ is up and running.