在ActiveMQ 5.15以下版本中,默认的ActiveMQ Web控制台上下文根路径为“admin”,但在ActiveMQ 5.15中该路径已更改为“activemq-web-console”。如果您将升级到ActiveMQ 5.15或更高版本,则需要相应地更改Web控制台的上下文根路径。
以下是一些示例代码,演示如何将ActiveMQ Web控制台的上下文根更改为“my-console”:
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
public class ChangeWebConsoleContextRoot {
public static void main(String[] args) throws Exception {
Server server = new Server(8080);
WebAppContext webAppContext = new WebAppContext();
webAppContext.setDescriptor("web/WEB-INF/web.xml");
webAppContext.setResourceBase("web");
webAppContext.setContextPath("/my-console"); // 设置上下文根路径为“/my-console”
server.setHandler(webAppContext);
server.start();
server.join();
}
}
// 设置上下文根路径为“/my-console”
无论您选择哪种方法,都需要重启ActiveMQ才能使更改生效。
上一篇:ActiveMQ5.15-改变web控制台的上下文根
下一篇:ActiveMQ5.15.9-当producerFlowControl为false且Systemusage未设置时,将存储限制为100GB。