【消息队列】RocketMQ在idea中启动

下载源码

https://github.com/apache/rocketmq.git,选择版本5.1.0

配置环境变量和创建配置文件

ROCKETMQ_HOME=D:\tools\mq\rocketmq_dev
  • ROCKETMQ_HOME的目录中创建conf和store目录
  • 在conf目录下面创建broker.conf,内容如下
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH


# 这是nameserver的启动地址,broker会基于该nameserver进行通信
namesrvAddr=127.0.0.1:9876
# 这是存储路径,你设置为你的rocketmq运行目录的store子目录
storePathRootDir=D:/tools/mq/rocketmq_dev/store
# 这是commitLog的存储路径
storePathCommitLog=D:/tools/mq/rocketmq_dev/store/commitlog
# consume queue文件的存储路径
storePathConsumeQueue=D:/tools/mq/rocketmq_dev/store/consumequeue
# 消息索引文件的存储路径
storePathIndex=D:/tools/mq/rocketmq_dev/store/index
# checkpoint文件的存储路径
storeCheckpoint=D:/tools/mq/rocketmq_dev/store/checkpoint
# abort文件的存储路径
abortFile=D:/tools/mq/rocketmq_dev/store/abort

启动NameServer

执行NamesrvStartup的main方法。日志打印

The Name Server boot success. serializeType=JSON, address 0.0.0.0:9876

启动Broker

在Program arguments中配置-c "D:\tools\mq\rocketmq_dev\conf\broker.conf",日志打印

The broker[broker-a, 10.132.17.10:10911] boot success. serializeType=JSON and name server is 127.0.0.1:9876

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值