启动消费
程序员文章站
2024-01-13 18:24:28
...
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) {
}
}
}
上一篇: C 预处理器