@echo off
setlocal

set ROCKETMQ_HOME=D:\workspace\rocketmq-all-4.9.8-bin-release

echo 正在启动 RocketMQ NameServer...
start "NameServer" cmd /k "%ROCKETMQ_HOME%\bin\mqnamesrv.cmd"

REM 延迟几秒确保 NameServer 已启动
ping 127.0.0.1 -n 5 >nul

echo 正在启动 RocketMQ Broker...
start "Broker" cmd /k "%ROCKETMQ_HOME%\bin\mqbroker.cmd -n 127.0.0.1:9876 -c %ROCKETMQ_HOME%\conf\broker.conf"

echo 所有 RocketMQ 组件已后台启动！
endlocal
