Created
January 4, 2020 06:04
-
-
Save iOnline247/f00f29d695fb75e219f5b39318f5da68 to your computer and use it in GitHub Desktop.
POST a simple message to an ActiveMQ Topic
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
$i = 0 | |
while($true) { | |
$password = ConvertTo-SecureString "admin" -AsPlainText -Force | |
$cred = New-Object System.Management.Automation.PSCredential "admin", $password | |
$i++ | |
$body = "test$i" | |
Invoke-RestMethod -Uri "http://activemq:8161/api/message/mqttsignal?type=topic" -Method Post -ContentType "text/plain" -Credential $cred -Body $body | |
if (($i % 3) -eq 0) { | |
Start-Sleep -Milliseconds 20 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment