Skip to content

Instantly share code, notes, and snippets.

@loa
Created August 15, 2014 09:58
Show Gist options
  • Save loa/b8cf4f407480d954fb36 to your computer and use it in GitHub Desktop.
Save loa/b8cf4f407480d954fb36 to your computer and use it in GitHub Desktop.
Netcat send to Stomp MQ
#!/bin/bash
# make sure netcat is installed
which nc || yum install -y nc
HOST="localhost"
PORT="61613"
LOGIN="guest"
PASSCODE="guest"
CHANNEL="stomp"
MSG="$1"
echo -en "CONNECT
login:${LOGIN}
passcode:${PASSCODE}
\x00
SEND
destination:/queue/${CHANNEL}
receipt:
${MSG}
\x00
" | nc $HOST $PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment