package com.gi.util;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
/**
* @描述 **
* @创建人
* @创建时间 $date$ $time$
*/
public class initServlet extends HttpServlet{
@Override
public void init() throws ServletException {
System.out.println("启动时消费");
ThreadMqUtil threadMqUtil = new ThreadMqUtil();
threadMqUtil.start();
try {
ActiveMqUtils.getMessage();
} catch (Exception e) {
}
System.out.println("消费完成");
}
}
public class ThreadMqUtil extends Thread {
@Override
public void run() {
try {
ActiveMqUtils.getMessage ();
System.out.println("线程");
} catch (Exception e) {
}
}
}
启动消费
最新推荐文章于 2020-12-07 11:42:28 发布