2 SPDX-FileCopyrightText: 2022 Frank Doepper
4 SPDX-License-Identifier: FSFAP
10 header: haskell-amqp-utils
11 footer: haskell-amqp-utils 0.6.5.0
16 konsum - an AMQP consumer.
19 **konsum** [*options*]
25 -r BINDINGKEY --bindingkey=BINDINGKEY AMQP binding key
26 -X[EXE] --execute[=EXE] Callback Script File (implies -t) (-X without arg: /usr/lib/haskell-amqp-utils/callback)
27 -a ARG --args=ARG, --arg=ARG additional argument for -X callback
28 -t[DIR] --tempdir[=DIR], --target[=DIR] tempdir (default: no file creation, -t without arg: /tmp)
29 -f INT --prefetch=INT Prefetch count. (0=unlimited, 1=off, default: 1)
30 -A --ack Toggle ack messages (default: True)
31 -R --requeuenack Toggle requeue when rejected (default: True)
32 --stream_offset=OFFSET x-stream-offset consumer argument
33 -l INT --charlimit=INT limit number of shown body chars (default: unlimited)
34 -q QUEUENAME --queue=QUEUENAME Ignore Exchange and bind to existing Queue
35 -i --simple call callback with one arg (filename) only
36 -j --cleanup Toggle remove tempfile after script call. Default False, but default True if --simple (-i)
37 -Q TEMPQNAME --qname=TEMPQNAME Name for temporary exclusive Queue
38 -x EXCHANGE --exchange=EXCHANGE AMQP Exchange (default: "")
39 -o SERVER --server=SERVER AMQP Server (default: localhost)
40 -y VHOST --vhost=VHOST AMQP Virtual Host (default: /)
41 -p PORT --port=PORT Server Port Number (default: 5672)
42 -T --tls Toggle TLS (default: False)
43 -c CERTFILE --cert=CERTFILE TLS Client Certificate File
44 -k KEYFILE --key=KEYFILE TLS Client Private Key File
45 -U USERNAME --user=USERNAME Username for Auth
46 -P PASSWORD --pass=PASSWORD Password for Auth
47 -s INT --heartbeats=INT heartbeat interval (0=disable, default: set by server)
48 -n NAME --name=NAME connection name, will be shown in RabbitMQ web interface
49 -w SECONDS --connect_timeout=SECONDS timeout for establishing initial connection (default: 600)
51 SPDX-FileCopyrightText: 2022 Frank Doepper
53 SPDX-License-Identifier: FSFAP
58 connect to localhost with default credentials and attach to a new temp
59 queue on the default exchange:
63 Connect to a host with TLS on a custom port, authenticating with SSL
64 client certificate. On every received message a callback is spawned.
65 The message will be ACKed when the callback exits successfully. First
66 500 bytes of the message body are printed to stderr. Header infos are
67 always printed to stderr:
69 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
71 Authenticate with user and pass. Attach to an existing queue. Generate a file
74 konsum -o amqp.example.com -U user -P pass -q queue -t
76 Provide a custom CA cert for proving the server's identity via
79 $ env SYSTEM_CERTIFICATE_PATH=/etc/amqp/cacert.crt konsum -T -y vhost -x exchange -r#
81 You can have no bindings, or you can bind the queue to one or multiple exchanges + binding keys:
83 konsum -x x1 -r b1 -r b2 -x x2 -r b3
85 would bind the queue to exchange x1 with binding keys b1 and b2 and to exchange x2 with binding key b3.
90 SPDX-FileCopyrightText: 2022 Frank Doepper
92 SPDX-License-Identifier: FSFAP
98 `konsum` and `arbeite` can execute programs (`-Xprogram`) on reception of a message.
100 ### normal (old) mode
102 The callback is called with the following arguments:
107 Optionally are added:
117 Message headers are added through several -h options:
121 Any additional arguments provided by `-a arg` options are appended.
123 ### simple (new) mode
125 Wenn called with `-i` (`--simple`), the callback is called with only the filename
126 as argument. Any additional arguments provided by `-a arg` options are prepended.
130 The arguments provided in normal (old) mode are also available as environment
131 variables in both modes in the callback:
144 And the remaining message properties, too:
156 Message headers, if any, are available as