2 generic AMQP commandline tools for use with RabbitMQ
5 - publisher (`agitprop`)
6 - rpc client and worker (`plane` / `arbeite`)
16 -r BINDINGKEY --bindingkey=BINDINGKEY AMQP binding key
17 -X[EXE] --execute[=EXE] Callback Script File (implies -t) (-X without arg: /usr/lib/haskell-amqp-utils/callback)
18 -a ARG --args=ARG additional argument for -X callback
19 -t[DIR] --tempdir[=DIR], --target[=DIR] tempdir (default: no file creation, -t without arg: /tmp)
20 -f INT --prefetch=INT Prefetch count. (0=unlimited, 1=off, default: 1)
21 -A --ack Toggle ack messages (default: True)
22 -R --requeuenack Toggle requeue when rejected (default: True)
23 -l INT --charlimit=INT limit number of shown body chars (default: unlimited)
24 -q QUEUENAME --queue=QUEUENAME Ignore Exchange and bind to existing Queue
25 -i --simple call callback with one arg (filename) only
26 -j --cleanup Toggle remove tempfile after script call. Default False, but default True if --simple (-i)
27 -Q TEMPQNAME --qname=TEMPQNAME Name for temporary exclusive Queue
28 -x EXCHANGE --exchange=EXCHANGE AMQP Exchange (default: "")
29 -o SERVER --server=SERVER AMQP Server (default: localhost)
30 -y VHOST --vhost=VHOST AMQP Virtual Host (default: /)
31 -p PORT --port=PORT Server Port Number (default: 5672)
32 -T --tls Toggle TLS (default: False)
33 -c CERTFILE --cert=CERTFILE TLS Client Certificate File
34 -k KEYFILE --key=KEYFILE TLS Client Private Key File
35 -U USERNAME --user=USERNAME Username for Auth
36 -P PASSWORD --pass=PASSWORD Password for Auth
37 -s INT --heartbeats=INT heartbeat interval (0=disable, default: set by server)
38 -n NAME --name=NAME connection name, will be shown in RabbitMQ web interface
39 -w SECONDS --connect_timeout=SECONDS timeout for establishing initial connection (default: 600)
43 connect to localhost with default credentials and attach to a new temp
44 queue on the default exchange:
48 Connect to a host with TLS on a custom port, authenticating with SSL
49 client certificate. On every received message a callback is spawned.
50 The message will be ACKed when the callback exits successfully. First
51 500 bytes of the message body are printed to stderr. Header infos are
52 always printed to stderr:
54 konsum -o amqp.example.com -p 5673 -T -k amqp-key.pem -c amqp-crt.pem -y vhost -x exchange -X./callback.sh -a -c -a callback.config.sh -f 2 -r binding.key.# -l 500
56 Authenticate with user and pass. Attach to an existing queue. Generate a file
59 konsum -o amqp.example.com -U user -P pass -q queue -t
61 Provide a custom CA cert for proving the server's identity via
64 $ env SYSTEM_CERTIFICATE_PATH=/etc/amqp/cacert.crt konsum -T -y vhost -x exchange -r#
66 You can have no bindings, or you can bind the queue to one or multiple exchanges + binding keys:
68 konsum -x x1 -r b1 -r b2 -x x2 -r b3
70 would bind the queue to exchange x1 with binding keys b1 and b2 and to exchange x2 with binding key b3.
80 -r ROUTINGKEY --routingkey=ROUTINGKEY AMQP routing key
81 -f INPUTFILE --inputfile=INPUTFILE Message input file (default: -)
82 -l --linemode Toggle line-by-line mode (default: False)
83 -C --confirm Toggle confirms (default: False)
85 --type=TYPE Message Type
86 --userid=USERID Message User-ID
87 --appid=APPID Message App-ID
88 --clusterid=CLUSTERID Message Cluster-ID
89 --contenttype=CONTENTTYPE Message Content-Type
90 --contentencoding=CONTENTENCODING Message Content-Encoding
91 --replyto=REPLYTO Message Reply-To
92 --prio=PRIO Message Priority
93 --corrid=CORRID Message CorrelationID
94 --exp=EXP Message Expiration
95 -h HEADER=VALUE --header=HEADER=VALUE Message Headers
96 -F HEADERNAME --fnheader=HEADERNAME Put filename into this header
97 -S SUFFIX --suffix=SUFFIX Allowed file suffixes in hotfolder mode
98 -u[DIR] --remove[=DIR], --move[=DIR] Remove (or move to DIR) sent file in hotfolder mode
99 -d --dirscan Toggle initial directory scan in hotfolder mode (default: False)
100 -m --magic Toggle setting content-type and -encoding from file contents (default: False)
101 -e --persistent Set persistent delivery
102 -E --nonpersistent Set nonpersistent delivery
103 -x EXCHANGE --exchange=EXCHANGE AMQP Exchange (default: "")
104 -o SERVER --server=SERVER AMQP Server (default: localhost)
105 -y VHOST --vhost=VHOST AMQP Virtual Host (default: /)
106 -p PORT --port=PORT Server Port Number (default: 5672)
107 -T --tls Toggle TLS (default: False)
108 -c CERTFILE --cert=CERTFILE TLS Client Certificate File
109 -k KEYFILE --key=KEYFILE TLS Client Private Key File
110 -U USERNAME --user=USERNAME Username for Auth
111 -P PASSWORD --pass=PASSWORD Password for Auth
112 -s INT --heartbeats=INT heartbeat interval (0=disable, default: set by server)
113 -n NAME --name=NAME connection name, will be shown in RabbitMQ web interface
114 -w SECONDS --connect_timeout=SECONDS timeout for establishing initial connection (default: 600)
116 If INPUTFILE is a file, the file is sent as a message and the program exits. If
117 INPUTFILE is a directory, the directory is watched via inotify ("hotfolder
118 mode") and every file, which is written and closed or moved in gets sent,
119 optionally only files which match one or several SUFFIXes. Optionally the file
120 name is written into a message header named HEADERNAME. Optionally
121 Content-Type and Content-Encoding headers are set via magic retrieved from file
124 Line-by-line mode sends one message per INPUTFILE line.
128 Send a message containing a file and put the filename into a fileName
131 agitprop -x amq.topic -r test -F fileName -f agitprop.hs
139 -r ROUTINGKEY --routingkey=ROUTINGKEY AMQP routing key
140 -f INPUTFILE --inputfile=INPUTFILE Message input file (default: -)
141 -O OUTPUTFILE --outputfile=OUTPUTFILE Message output file (default: -)
142 -t SECONDS --rpc_timeout=SECONDS How long to wait for reply (default: 5.0)
143 --corrid=CORRID Message CorrelationID
144 --exp=EXP Message Expiration
145 -h HEADER=VALUE --header=HEADER=VALUE Message Headers
146 -l INT --charlimit=INT limit number of shown body chars (default: unlimited)
147 -x EXCHANGE --exchange=EXCHANGE AMQP Exchange (default: "")
148 -o SERVER --server=SERVER AMQP Server (default: localhost)
149 -y VHOST --vhost=VHOST AMQP Virtual Host (default: /)
150 -p PORT --port=PORT Server Port Number (default: 5672)
151 -T --tls Toggle TLS (default: False)
152 -c CERTFILE --cert=CERTFILE TLS Client Certificate File
153 -k KEYFILE --key=KEYFILE TLS Client Private Key File
154 -U USERNAME --user=USERNAME Username for Auth
155 -P PASSWORD --pass=PASSWORD Password for Auth
156 -s INT --heartbeats=INT heartbeat interval (0=disable, default: set by server)
157 -n NAME --name=NAME connection name, will be shown in RabbitMQ web interface
158 -w SECONDS --connect_timeout=SECONDS timeout for establishing initial connection (default: 600)
162 send "ls" to a remote worker and get the result:
164 echo ls | plane -o amqp.example.com -T -k amqp.pem -c amqp.pem -y myexchange -Q rpctest
172 -X[EXE] --execute[=EXE] Callback Script File (implies -t) (-X without arg: /usr/lib/haskell-amqp-utils/callback)
173 -a ARG --args=ARG additional argument for -X callback
174 -t[DIR] --tempdir[=DIR], --target[=DIR] tempdir (default: no file creation, -t without arg: /tmp)
175 -f INT --prefetch=INT Prefetch count. (0=unlimited, 1=off, default: 1)
176 -A --ack Toggle ack messages (default: True)
177 -R --requeuenack Toggle requeue when rejected (default: True)
178 -l INT --charlimit=INT limit number of shown body chars (default: unlimited)
179 -q QUEUENAME --queue=QUEUENAME Ignore Exchange and bind to existing Queue
180 -i --simple call callback with one arg (filename) only
181 -j --cleanup Toggle remove tempfile after script call. Default False, but default True if --simple (-i)
182 -Q TEMPQNAME --qname=TEMPQNAME Name for temporary exclusive Queue
183 -x EXCHANGE --exchange=EXCHANGE AMQP Exchange (default: "")
184 -o SERVER --server=SERVER AMQP Server (default: localhost)
185 -y VHOST --vhost=VHOST AMQP Virtual Host (default: /)
186 -p PORT --port=PORT Server Port Number (default: 5672)
187 -T --tls Toggle TLS (default: False)
188 -c CERTFILE --cert=CERTFILE TLS Client Certificate File
189 -k KEYFILE --key=KEYFILE TLS Client Private Key File
190 -U USERNAME --user=USERNAME Username for Auth
191 -P PASSWORD --pass=PASSWORD Password for Auth
192 -s INT --heartbeats=INT heartbeat interval (0=disable, default: set by server)
193 -n NAME --name=NAME connection name, will be shown in RabbitMQ web interface
194 -w SECONDS --connect_timeout=SECONDS timeout for establishing initial connection (default: 600)
198 provide shell access to a remote user. Very insecure! :-)
200 arbeite -o amqp.example.com -T -k amqp.pem -c amqp.pem -y myexchange -Q rpctest -i -Xsh
204 `konsum` and `arbeite` can execute programs (`-Xprogram`) on reception of a message.
206 ### normal (old) mode
208 The callback is called with the following arguments:
213 Optionally are added:
223 Message headers are added through several -h options:
227 Any additional arguments provided by `-a arg` options are appended.
229 ### simple (new) mode
231 Wenn called with `-i` (`--simple`), the callback is called with only the filename
232 as argument. Any additional arguments provided by `-a arg` options are prepended.
236 The arguments provided in normal (old) mode are also available as environment
237 variables in both modes in the callback:
250 And the remaining message properties, too:
262 Message headers, if any, are available as
273 - git://woffs.de/git/fd/haskell-amqp-utils.git
274 - https://woffs.de/git/fd/haskell-amqp-utils.git
275 - https://git.sr.ht/~woffs/haskell-amqp-utils
276 - https://repology.org/project/haskell:amqp-utils/packages