Created
May 21, 2020 14:01
-
-
Save dimalyshev/1854e2d6ed51da7fcbd4846fe4349f44 to your computer and use it in GitHub Desktop.
Stress test for MQ connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Reproduce connection multiplication on RabbitMQ shutdown | |
rem Use rabbitmqctl, sor REQUIRES | |
rem set PATH=%PATH%;"c:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.3\sbin" | |
echo off | |
del demo-*.log demo-connections-*.log | |
set OUTPUT=demo-connections-%date%.log | |
:: RUN dotnet run | |
dotnet build --nologo -v q %1 >nul | |
::run | |
:: prepare demo env | |
set rabbitmquri=amqp://localhost | |
set serilog:writeto:0:name=Console | |
set serilog:minimumlevel=Verbose | |
set dbconnectionstring=Server=(localdb)\.;Database=storedb | |
set EventBusRetryCount=5 | |
::run app | |
start "Demo" cmd /c dotnet run --no-build --no-launch-profile -p %1 --environment demo ^>demo-%date%.log | |
echo ==== starting simulation | |
for /L %%i in (1,1,5) do ( | |
echo shutdown #%%i | |
call:kick_all %%i >>%OUTPUT% | |
) | |
goto:eof | |
rem SHUTDOWN SIMULATION | |
:kick_all | |
timeout /t 3 >nul | |
set NAME="My connection break #%1" | |
echo ===== MQ connections before: %NAME% | |
cmd /c "rabbitmqctl list_connections channels vhost name" | |
cmd /c "rabbitmqctl close_all_connections %NAME%" | |
goto:eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script to test behaviour on MQ connection shutdown