我在jmeter中对一个http接口进行了一百次请求
接口如下:
@GetMapping("send")
public void send(String msg) {
// 指定消息发送的目的地及内容
System.out.println(new Date().toString());
queueMessageService.setTopic("topic",msg);
}
调用的Bean
@Component
public class QueueMessageService {
@Autowired
private JmsMessagingTemplate jmsMessagingTemplate;
public void setQueue(String queue,String msg){
jmsMessagingTemplate.convertAndSend(new ActiveMQQueue(queue),msg);
}
public void setTopic(String topic,String msg) {
jmsMessagingTemplate.convertAndSend(new ActiveMQTopic(topic),msg);
}
}
我使用了两个消费者用于接收请求
@JmsListener(destination = "topic")
public void receiveMessage(String message) throws InterruptedException {
Thread.sleep(4000);
System.out.println(hfnsTermService.getCount());
System.out.println(new Date().toString()+"topic接收:"+message);
}
@JmsListener(destination = "topic")
public void readResponse(String message) throws InterruptedException {
Thread.sleep(1000);
for(HfnsTerm hfnsTerm:hfnsTermService.getHfnsTerm()){
System.out.println(hfnsTerm.getId());
}
System.out.println(new Date().toString()+"topic1接收:"+message);
}
当我在请求还没完全接收完时在activemq控制台把topic队列进行了删除操作
此时activemq中是没有topic队列的,但是我依然能够接收到topic队列中的消息
请问这是为什么?