Compare commits
5 Commits
81e540dda8
...
edc2e7cd87
Author | SHA1 | Date | |
---|---|---|---|
![]() |
edc2e7cd87 | ||
![]() |
7514add794 | ||
![]() |
ffc3d69ab9 | ||
![]() |
a77475ef44 | ||
![]() |
5bd51b3189 |
28
base/Resources/rocketmq/conf/broker-localhost.conf
Normal file
28
base/Resources/rocketmq/conf/broker-localhost.conf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# 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
|
||||||
|
autoCreateTopicEnable=true
|
||||||
|
autoCreateSubscriptionGroup=true
|
||||||
|
listenPort=10911
|
||||||
|
namesrvAddr=localhost:9876
|
||||||
|
storePathRootDir=./store
|
||||||
|
storePathCommitLog=./store/commitlog
|
1
base/Resources/rocketmq/sbin/.gitignore
vendored
Normal file
1
base/Resources/rocketmq/sbin/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
store/
|
36
base/Resources/rocketmq/sbin/initial-consumer.bat
Normal file
36
base/Resources/rocketmq/sbin/initial-consumer.bat
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
chcp 65001 >nul
|
||||||
|
title RocketMQ Consumer Group Initialization
|
||||||
|
|
||||||
|
:: BROKER_NAME
|
||||||
|
set "BROKER_NAME=broker-a"
|
||||||
|
:: 集群名称
|
||||||
|
set "CLUSTER_NAME=DefaultCluster"
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo [INFO] 正在创建消费者组
|
||||||
|
for %%g in (
|
||||||
|
"SIMULATION_FIFO_001"
|
||||||
|
"CID_standard_topic_sample"
|
||||||
|
"CID_ONSAPI_OWNER"
|
||||||
|
"SELF_TEST_C_GROUP"
|
||||||
|
"SIMULATION_FIFO_002"
|
||||||
|
"TOOLS_CONSUMER"
|
||||||
|
"CID_ONSAPI_PULL"
|
||||||
|
"CID_ONSAPI_PERMISSION"
|
||||||
|
"CID_RMQ_SYS_TRANS"
|
||||||
|
"FILTERSRV_CONSUMER"
|
||||||
|
"CID_ONS-HTTP-PROXY"
|
||||||
|
) do (
|
||||||
|
echo [INFO] 创建消费者组: %%~g
|
||||||
|
curl -X POST ^
|
||||||
|
http://localhost:8088/consumer/createOrUpdate.do ^
|
||||||
|
-H "Content-Type: application/json" ^
|
||||||
|
-d "{\"brokerNameList\":[\"%BROKER_NAME%\"],\"subscriptionGroupConfig\":{\"groupName\":\"%%~g\",\"consumeEnable\":true,\"consumeMessageOrderly\":false,\"consumeFromMinEnable\":true,\"consumeBroadcastEnable\":true,\"retryQueueNums\":1,\"retryMaxTimes\":16,\"brokerId\":0,\"whichBrokerWhenConsumeSlowly\":1},\"clusterNameList\":[\"%CLUSTER_NAME%\"]}"
|
||||||
|
echo.
|
||||||
|
)
|
||||||
|
|
||||||
|
echo 所有消费者组创建完成!
|
||||||
|
pause
|
||||||
|
exit /b 0
|
37
base/Resources/rocketmq/sbin/initial-topic.bat
Normal file
37
base/Resources/rocketmq/sbin/initial-topic.bat
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
chcp 65001 >nul
|
||||||
|
title RocketMQ Topic Initialization
|
||||||
|
|
||||||
|
:: BROKER_NAME
|
||||||
|
set "BROKER_NAME=broker-a"
|
||||||
|
:: 集群名称
|
||||||
|
set "CLUSTER_NAME=DefaultCluster"
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo [INFO] 正在创建普通主题
|
||||||
|
for %%t in (
|
||||||
|
"rt-efficiency-index"
|
||||||
|
"scenario-content-publish"
|
||||||
|
"scenario-content-subscribe"
|
||||||
|
"scenario-factor-publish"
|
||||||
|
"scenario-factor-subscribe"
|
||||||
|
"simulation-command"
|
||||||
|
"simulation-engine"
|
||||||
|
"simulation-running-control-percent"
|
||||||
|
"simulation-running-control-sse"
|
||||||
|
"simulation-task-feedback"
|
||||||
|
"simulation-task-publish"
|
||||||
|
"simulation-trainExRl"
|
||||||
|
) do (
|
||||||
|
echo [INFO] 创建普通主题: %%~t
|
||||||
|
curl -X POST ^
|
||||||
|
http://localhost:8088/topic/createOrUpdate.do ^
|
||||||
|
-H "Content-Type: application/json" ^
|
||||||
|
-d "{\"writeQueueNums\":8,\"readQueueNums\":8,\"perm\":6,\"order\":false,\"topicName\":\"%%~t\",\"brokerNameList\":[\"%BROKER_NAME%\"],\"messageType\":\"NORMAL\",\"clusterNameList\":[\"%CLUSTER_NAME%\"]}"
|
||||||
|
echo.
|
||||||
|
)
|
||||||
|
|
||||||
|
echo 所有主题创建完成!
|
||||||
|
pause
|
||||||
|
exit /b 0
|
@ -22,7 +22,6 @@ if not exist "%ROCKETMQ_HOME%\bin\mqnamesrv.cmd" (
|
|||||||
if "%JAVA_HOME%" == "" (
|
if "%JAVA_HOME%" == "" (
|
||||||
echo [WARN] JAVA_HOME is not set, trying to find Java automatically...
|
echo [WARN] JAVA_HOME is not set, trying to find Java automatically...
|
||||||
goto :FOUNING_JAVA
|
goto :FOUNING_JAVA
|
||||||
|
|
||||||
) else (
|
) else (
|
||||||
if not exist "%JAVA_HOME%\bin\java.exe" (
|
if not exist "%JAVA_HOME%\bin\java.exe" (
|
||||||
echo [WARN] %JAVA_HOME%\bin\java.exe is not exist, trying to find Java automatically...
|
echo [WARN] %JAVA_HOME%\bin\java.exe is not exist, trying to find Java automatically...
|
||||||
@ -67,14 +66,21 @@ exit /b 1
|
|||||||
:START_SERVER
|
:START_SERVER
|
||||||
echo [INFO] Using JAVA_HOME: %JAVA_HOME%
|
echo [INFO] Using JAVA_HOME: %JAVA_HOME%
|
||||||
|
|
||||||
|
if exist "%ROCKETMQ_HOME%\sbin\store\" (
|
||||||
|
set "INITIAL=TRUE"
|
||||||
|
)
|
||||||
|
|
||||||
:: 4. 启动 NameServer
|
:: 4. 启动 NameServer
|
||||||
start "RocketMQ NameServer" cmd /k "%ROCKETMQ_HOME%\bin\mqnamesrv.cmd"
|
start "RocketMQ NameServer" cmd /k "%ROCKETMQ_HOME%\bin\mqnamesrv.cmd"
|
||||||
|
|
||||||
:: 等待 NameServer 启动
|
:: 等待 NameServer 启动
|
||||||
timeout /t 10 /nobreak >nul
|
timeout /t 5 /nobreak >nul
|
||||||
|
|
||||||
:: 5. 启动 Broker(如果需要直接访问 Broker,可单独启动)
|
:: 5. 启动 Broker(如果需要直接访问 Broker,可单独启动)
|
||||||
start "RocketMQ Broker" cmd /k "%ROCKETMQ_HOME%\bin\mqbroker.cmd" -n localhost:9876 autoCreateTopicEnable=true
|
:: start "RocketMQ Broker" cmd /k "%ROCKETMQ_HOME%\bin\mqbroker.cmd" -n localhost:9876
|
||||||
|
:: start "RocketMQ Broker" cmd /k "%ROCKETMQ_HOME%\bin\mqbroker.cmd" -n localhost:9876 autoCreateTopicEnable=true
|
||||||
|
:: start "RocketMQ Broker" cmd /k "%ROCKETMQ_HOME%\bin\mqbroker.cmd" -n localhost:9876 -c ../conf/broker.conf
|
||||||
|
start "RocketMQ Broker" cmd /k "%ROCKETMQ_HOME%\bin\mqbroker.cmd" -c ../conf/broker-localhost.conf
|
||||||
|
|
||||||
:: 等待 Broker 启动
|
:: 等待 Broker 启动
|
||||||
timeout /t 10 /nobreak >nul
|
timeout /t 10 /nobreak >nul
|
||||||
@ -96,5 +102,11 @@ echo - Broker (端口: 10911)
|
|||||||
echo - Proxy (端口: 8081)
|
echo - Proxy (端口: 8081)
|
||||||
echo - Dashboard (端口: 8080)
|
echo - Dashboard (端口: 8080)
|
||||||
|
|
||||||
|
:: if "%INITIAL%"="" (
|
||||||
|
:: timeout /t 2 /nobreak >nul
|
||||||
|
:: echo RocketMQ 数据初始化...
|
||||||
|
:: start "Rocket Create Topic" "initial-topic.bat"
|
||||||
|
:: start "Rocket Create Consumer" "initial-consumer.bat"
|
||||||
|
:: )
|
||||||
pause
|
pause
|
||||||
endlocal
|
endlocal
|
Loading…
x
Reference in New Issue
Block a user