]> woffs.de Git - fd/haskell-amqp-utils.git/blob - README.md
formatting
[fd/haskell-amqp-utils.git] / README.md
1 # haskell-amqp-utils
2 generic Haskell AMQP commandline tools for use with RabbitMQ
3
4 ## Repository access
5
6 - git://woffs.de/git/fd/haskell-amqp-utils.git
7 - https://woffs.de/git/fd/haskell-amqp-utils.git
8 - https://github.com/woffs/haskell-amqp-utils
9
10 ## Overview
11 The package contains 4 binaries for commandline use.
12
13 - konsum, a generic consumer
14 - agitprop, a generic publisher
15 - arbeite, an rpc server
16 - plane, an rpc client
17
18 ## konsum
19 ### usage
20
21     konsum [options]
22
23     Options:
24       -r BINDINGKEY  --bindingkey=BINDINGKEY          AMQP binding key (default: #)
25       -X[EXE]        --execute[=EXE]                  Callback Script File (implies -t) (-X without arg: /usr/lib/haskell-amqp-utils/callback)
26       -a ARG         --args=ARG                       additional argument for -X callback
27       -t[DIR]        --tempdir[=DIR], --target[=DIR]  tempdir (default: no file creation, -t without arg: /tmp)
28       -f INT         --prefetch=INT                   Prefetch count. (0=unlimited, 1=off, default: 1)
29       -A             --ack                            Toggle ack messages (default: True)
30       -R             --requeuenack                    Toggle requeue when rejected (default: True)
31       -l INT         --charlimit=INT                  limit number of shown body chars (default: unlimited)
32       -q QUEUENAME   --queue=QUEUENAME                Ignore Exchange and bind to existing Queue
33       -i             --simple                         call callback with one arg (filename) only
34       -j             --cleanup                        Toggle remove tempfile after script call. Default False, but default True if --simple (-i)
35       -Q TEMPQNAME   --qname=TEMPQNAME                Name for temporary exclusive Queue
36       -x EXCHANGE    --exchange=EXCHANGE              AMQP Exchange (default: "")
37       -o SERVER      --server=SERVER                  AMQP Server (default: localhost)
38       -y VHOST       --vhost=VHOST                    AMQP Virtual Host (default: /)
39       -p PORT        --port=PORT                      Server Port Number (default: 5672)
40       -T             --tls                            Toggle TLS (default: False)
41       -c CERTFILE    --cert=CERTFILE                  TLS Client Certificate File
42       -k KEYFILE     --key=KEYFILE                    TLS Client Private Key File
43       -U USERNAME    --user=USERNAME                  Username for Auth
44       -P PASSWORD    --pass=PASSWORD                  Password for Auth
45       -s INT         --heartbeats=INT                 heartbeat interval (0=disable, default: set by server)
46       -n NAME        --name=NAME                      connection name, will be shown in RabbitMQ web interface
47       -w SECONDS     --connect_timeout=SECONDS        timeout for establishing initial connection (default: 60)
48
49 ### examples
50
51 connect to localhost with default credentials and attach to a new temp
52 queue on the default exchange (which will usually fail because attaching
53 a queue to the default exchange is not allowed):
54
55     konsum
56
57 Connect to a host with TLS on a custom port, authenticating with SSL
58 client certificate. On every received message a callback is spawned.
59 The message will be ACKed when the callback exits successfully. First
60 500 bytes of the message body are printed to stderr. Header infos are
61 always printed to stderr:
62
63     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 routing.key.# -l 500
64
65 Authenticate with user and pass. Attach to an existing queue. Generate a file
66 for every message:
67
68     konsum -o amqp.example.com -U user -P pass -q queue -t
69
70 Provide a custom CA cert for proving the server's identity via
71 enviroment:
72
73     $ env SYSTEM_CERTIFICATE_PATH=/etc/amqp/cacert.crt konsum -T -y vhost -x exchange
74
75 Stop with ^C
76
77 ## agitprop
78 ### usage
79
80     agitprop [options]
81
82     Options:
83       -r ROUTINGKEY    --routingkey=ROUTINGKEY            AMQP routing key
84       -f INPUTFILE     --inputfile=INPUTFILE              Message input file (default: -)
85       -l               --linemode                         Toggle line-by-line mode (default: False)
86       -C               --confirm                          Toggle confirms (default: False)
87                        --msgid=ID                         Message ID
88                        --type=TYPE                        Message Type
89                        --userid=USERID                    Message User-ID
90                        --appid=APPID                      Message App-ID
91                        --clusterid=CLUSTERID              Message Cluster-ID
92                        --contenttype=CONTENTTYPE          Message Content-Type
93                        --contentencoding=CONTENTENCODING  Message Content-Encoding
94                        --replyto=REPLYTO                  Message Reply-To
95                        --prio=PRIO                        Message Priority
96                        --corrid=CORRID                    Message CorrelationID
97                        --exp=EXP                          Message Expiration
98       -h HEADER=VALUE  --header=HEADER=VALUE              Message Headers
99       -F HEADERNAME    --fnheader=HEADERNAME              Put filename into this header
100       -S SUFFIX        --suffix=SUFFIX                    Allowed file suffixes in hotfolder mode
101       -m               --magic                            Toggle setting content-type and -encoding from file contents (default: False)
102       -e               --persistent                       Set persistent delivery
103       -E               --nonpersistent                    Set nonpersistent delivery
104       -x EXCHANGE      --exchange=EXCHANGE                AMQP Exchange (default: "")
105       -o SERVER        --server=SERVER                    AMQP Server (default: localhost)
106       -y VHOST         --vhost=VHOST                      AMQP Virtual Host (default: /)
107       -p PORT          --port=PORT                        Server Port Number (default: 5672)
108       -T               --tls                              Toggle TLS (default: False)
109       -c CERTFILE      --cert=CERTFILE                    TLS Client Certificate File
110       -k KEYFILE       --key=KEYFILE                      TLS Client Private Key File
111       -U USERNAME      --user=USERNAME                    Username for Auth
112       -P PASSWORD      --pass=PASSWORD                    Password for Auth
113       -s INT           --heartbeats=INT                   heartbeat interval (0=disable, default: set by server)
114       -n NAME          --name=NAME                        connection name, will be shown in RabbitMQ web interface
115       -w SECONDS       --connect_timeout=SECONDS          timeout for establishing initial connection (default: 60)
116
117 If INPUTFILE is a file, the file is sent as a message and the program
118 exits. If INPUTFILE is a directory, the directory is watched via inotify
119 and every file, which is written and closed or moved in gets sent,
120 optionally only files which match one or several SUFFIXes. Optionally
121 the file name is written into a message header named HEADERNAME.
122 Optionally Content-Type and Content-Encoding headers are set via magic
123 retrieved from file contents.
124
125 Line-by-line mode sends one message per INPUTFILE line.
126
127 ### examples
128
129 Send a message containing a file and put the filename into a fileName
130 message header:
131
132     agitprop -x amq.topic -r test -F fileName -f agitprop.hs
133
134 ## plane
135 ### usage
136
137     plane [options]
138
139     Options:
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       -Q TEMPQNAME     --qname=TEMPQNAME          Name for temporary exclusive Queue
148       -x EXCHANGE      --exchange=EXCHANGE        AMQP Exchange (default: "")
149       -o SERVER        --server=SERVER            AMQP Server (default: localhost)
150       -y VHOST         --vhost=VHOST              AMQP Virtual Host (default: /)
151       -p PORT          --port=PORT                Server Port Number (default: 5672)
152       -T               --tls                      Toggle TLS (default: False)
153       -c CERTFILE      --cert=CERTFILE            TLS Client Certificate File
154       -k KEYFILE       --key=KEYFILE              TLS Client Private Key File
155       -U USERNAME      --user=USERNAME            Username for Auth
156       -P PASSWORD      --pass=PASSWORD            Password for Auth
157       -s INT           --heartbeats=INT           heartbeat interval (0=disable, default: set by server)
158       -n NAME          --name=NAME                connection name, will be shown in RabbitMQ web interface
159       -w SECONDS       --connect_timeout=SECONDS  timeout for establishing initial connection (default: 60)
160
161 ### examples
162
163 send "ls" to a remote worker and get the result:
164
165     echo ls | plane -o amqp.example.com -T -k amqp.pem -c amqp.pem -y myexchange -Q rpctest
166
167 ## arbeite
168 ### usage
169
170     arbeite [options]
171
172     Options:
173       -X[EXE]       --execute[=EXE]                  Callback Script File (implies -t) (-X without arg: /usr/lib/haskell-amqp-utils/callback)
174       -a ARG        --args=ARG                       additional argument for -X callback
175       -t[DIR]       --tempdir[=DIR], --target[=DIR]  tempdir (default: no file creation, -t without arg: /tmp)
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: 60)
195
196 ### examples
197
198 provide shell access to a remote user. Very insecure! :-)
199
200     arbeite -o amqp.example.com -T -k amqp.pem -c amqp.pem -y myexchange -Q rpctest -i -Xsh
201