activeMQ学习指南 - 入门安装和启动

activeMQ学习指南 - 入门安装和启动

介绍

ActiveMQ是一种开源的基于JMS(Java Message Servie)规范的一种消息中间件的实现,ActiveMQ的设计目标是提供标准的,面向消息的,能够跨越多语言和多系统的应用集成消息通信中间件。

下载

官网下载

https://activemq.apache.org/components/artemis/download/

安装

  • 解压
  • 创建Broker
// 目录 d:\activeMQ
PS D:\apache-artemis-2.16.0-bin\apache-artemis-2.16.0\bin> .\artemis create d:\activeMQ
Creating ActiveMQ Artemis instance at: D:\activeMQ

// 登录用户名
--user: is a mandatory property!
Please provide the default username:
admin

// 登录密码
--password: is mandatory with this configuration:
Please provide the default password:

// 允许匿名
--allow-anonymous | --require-login: is a mandatory property!
Allow anonymous access?, valid values are Y,N,True,False
Y

Auto tuning journal ...
done! Your system can make 0.03 writes per millisecond, your journal-buffer-timeout will be 37360000

You can now start the broker by executing:

"D:\activeMQ\bin\artemis" run

// 需要安装成windows服务
Or you can setup the broker as Windows service and run it in the background:

"D:\activeMQ\bin\artemis-service.exe" install
"D:\activeMQ\bin\artemis-service.exe" start

To stop the windows service:
"D:\activeMQ\bin\artemis-service.exe" stop

To uninstall the windows service
"D:\activeMQ\bin\artemis-service.exe" uninstall
  • 进入目录
  • 启动
PS D:\activeMQ\bin> .\artemis.cmd run
_ _ _
/ \ ____| |_ ___ __ __(_) _____
/ _ \| _ \ __|/ _ \ \/ | |/ __/
/ ___ \ | \/ |_/ __/ |\/| | |\___ \
/_/ \_\| \__\____|_| |_|_|/___ /
Apache ActiveMQ Artemis 2.16.0


2021-01-07 14:20:21,182 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
2021-01-07 14:20:22,693 INFO [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)
2021-01-07 14:20:22,746 INFO [org.apache.activemq.artemis.core.server] AMQ221013: Using NIO Journal
2021-01-07 14:20:22,821 INFO [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 536,870,912
2021-01-07 14:20:22,852 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
2021-01-07 14:20:22,854 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
2021-01-07 14:20:22,855 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
2021-01-07 14:20:22,856 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT
2021-01-07 14:20:22,857 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE
2021-01-07 14:20:22,858 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
2021-01-07 14:20:22,980 INFO [org.apache.activemq.artemis.core.server] AMQ221034: Waiting indefinitely to obtain live lock
2021-01-07 14:20:22,980 INFO [org.apache.activemq.artemis.core.server] AMQ221035: Live Server Obtained live lock
2021-01-07 14:20:23,733 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address DLQ supporting [ANYCAST]
2021-01-07 14:20:23,825 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue DLQ on address DLQ
2021-01-07 14:20:23,932 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address ExpiryQueue supporting [ANYCAST]
2021-01-07 14:20:23,963 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue ExpiryQueue on address ExpiryQueue
2021-01-07 14:20:25,597 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:61616 for protocols [CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE]
2021-01-07 14:20:25,614 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:5445 for protocols [HORNETQ,STOMP]
2021-01-07 14:20:25,625 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:5672 for protocols [AMQP]
2021-01-07 14:20:25,638 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:1883 for protocols [MQTT]
2021-01-07 14:20:25,651 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started NIO Acceptor at 0.0.0.0:61613 for protocols [STOMP]
2021-01-07 14:20:25,714 INFO [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live
2021-01-07 14:20:25,714 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.16.0 [0.0.0.0, nodeID=6c4d3fb3-50b0-11eb-9ccb-78e40011f8fc]
2021-01-07 14:20:26,336 INFO [org.apache.activemq.hawtio.branding.PluginContextListener] Initialized activemq-branding plugin
2021-01-07 14:20:26,509 INFO [org.apache.activemq.hawtio.plugin.PluginContextListener] Initialized artemis-plugin plugin
2021-01-07 14:20:28,249 INFO [io.hawt.HawtioContextListener] Initialising hawtio services
2021-01-07 14:20:28,270 INFO [io.hawt.system.ConfigManager] Configuration will be discovered via system properties
2021-01-07 14:20:28,274 INFO [io.hawt.jmx.JmxTreeWatcher] Welcome to Hawtio 2.11.0
2021-01-07 14:20:28,281 INFO [io.hawt.web.auth.AuthenticationConfiguration] Starting hawtio authentication filter, JAAS realm: "activemq" authorized role(s): "amq" role principal classes: "org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal"
2021-01-07 14:20:28,299 INFO [io.hawt.web.proxy.ProxyServlet] Proxy servlet is disabled
2021-01-07 14:20:28,306 INFO [io.hawt.web.servlets.JolokiaConfiguredAgentServlet] Jolokia overridden property: [key=policyLocation, value=file:/d:/activeMQ/etc/\jolokia-access.xml]
2021-01-07 14:20:28,991 INFO [org.apache.activemq.artemis] AMQ241001: HTTP Server started at http://localhost:8161
2021-01-07 14:20:28,991 INFO [org.apache.activemq.artemis] AMQ241002: Artemis Jolokia REST API available at http://localhost:8161/console/jolokia
2021-01-07 14:20:28,992 INFO [org.apache.activemq.artemis] AMQ241004: Artemis Console available at http://localhost:8161/console

访问

访问 http://localhost:8161/console

文章作者: 杨振宇
文章链接: https://www.yangzhenyu.com.cn/19336/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 杨振宇 个人经验
支付宝打赏
微信打赏