JMS消息消费
我不确定以下场景中会发生什么,如果有人解释的话将会有很大帮助。
生产者(P)发送消息M1、M2、M3、M4、M5、M6、M7;假设它是从时间T1到T7发送的。
消息消费者(L)将是绑定到主题的侦听器。 主题名称:jmsTopic
场景 1:
JMS 代理正在运行,L 未连接到 jmsTopic。 P将M1到M7发送到jmsTopic。如果 L 在时间 T8(大于 T7)连接到 jmsTopic,它会接收消息 M1 到 M7 还是仅接收在时间 T8 之后发送到主题的消息。
场景 2:
JMS 代理正在运行,L 已连接并侦听 jmsTopic。 P 将 M1 发送到 M4。 L接收M1至M4。在L处理M1到M4的同时,P发送M5到M7,但是L在处理M4期间崩溃了。如果 L 再次将自身连接到 jmsTopic,它是否会收到 M5 到 M7,或者只有 L 连接到 jmsTopic 之后发送的消息才会被 L 接收。
场景 3:
JMS 代理正在运行,L 已连接并侦听 jmsTopic,P 发送 M1至 M7。然而经纪人崩溃了; L 了解代理状态并在 AMQ 启动并运行后重新连接。
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.
Message Consumer (L) will be a listener bound to the topic.
Topic Name : jmsTopic
Scenario 1:
JMS broker is running, L is not connected to jmsTopic. 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:
JMS broker 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:
JMS broker is running, L is connected and listening to jmsTopic, P sends M1 to M7. However the broker crashes; is L aware of broker status and reconnects once AMQ is up and running.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
队列的全部目的是保证交付。在侦听器将消息从队列中取出之前,不会处理任何消息,因此在 T8 之前到达的所有消息都会在那里。
#1 相同:所有消息 M5 及更新的消息都将由侦听器接收。
设置AMQ以保证交付;所有消息都将被序列化,以保证收到后送达。
The whole point of the queue is to guarantee delivery. No messages are processed until a listener takes them off the queue, so all messages that arrive before T8 will be there.
Same as #1: all messages M5 and newer will be received by the listener.
Set up AMQ for guaranteed delivery; all messages will be serialized to guarantee delivery on receipt.