@Test
public void contextLoads() throws Exception{
int flag = 0;
while(true){
Thread.sleep(2000);
sender.send("hello … "+flag++);
}
}
}
启动消费者和服务提供者
当我们在15的时候关闭消费者,然后在启动消费者我们看情况。
我们会发现在消费者下线的这段时间产生的消息并没有丢失
@Test
public void contextLoads() throws Exception{
int flag = 0;
while(true){
Thread.sleep(2000);
sender.send("hello … "+flag++);
}
}
}
启动消费者和服务提供者
当我们在15的时候关闭消费者,然后在启动消费者我们看情况。
我们会发现在消费者下线的这段时间产生的消息并没有丢失