]> woffs.de Git - fd/haskell-amqp-utils.git/blob - doc/arbeite.md
LineBuffering
[fd/haskell-amqp-utils.git] / doc / arbeite.md
1 <!--
2 SPDX-FileCopyrightText: 2022 Frank Doepper
3
4 SPDX-License-Identifier: FSFAP
5 -->
6
7 ---
8 title: arbeite
9 section: 1
10 header: haskell-amqp-utils
11 footer: haskell-amqp-utils 0.6.5.0
12 date: 2022-11-11
13 ---
14
15 # NAME
16 arbeite - an AMQP RPC worker.
17
18 # SYNOPSIS
19 **arbeite** [*options*]
20
21 # DESCRIPTION
22
23 # OPTIONS
24       -X[EXE]       --execute[=EXE]                  Callback Script File (implies -t) (-X without arg: /usr/lib/haskell-amqp-utils/callback)
25       -a ARG        --args=ARG, --arg=ARG            additional argument for -X callback
26       -t[DIR]       --tempdir[=DIR], --target[=DIR]  tempdir (default: no file creation, -t without arg: /tmp)
27       -f INT        --prefetch=INT                   Prefetch count. (0=unlimited, 1=off, default: 1)
28       -A            --ack                            Toggle ack messages (default: True)
29       -R            --requeuenack                    Toggle requeue when rejected (default: True)
30       -l INT        --charlimit=INT                  limit number of shown body chars (default: unlimited)
31       -q QUEUENAME  --queue=QUEUENAME                Ignore Exchange and bind to existing Queue
32       -i            --simple                         call callback with one arg (filename) only
33       -j            --cleanup                        Toggle remove tempfile after script call. Default False, but default True if --simple (-i)
34       -Q TEMPQNAME  --qname=TEMPQNAME                Name for temporary exclusive Queue
35       -x EXCHANGE   --exchange=EXCHANGE              AMQP Exchange (default: "")
36       -o SERVER     --server=SERVER                  AMQP Server (default: localhost)
37       -y VHOST      --vhost=VHOST                    AMQP Virtual Host (default: /)
38       -p PORT       --port=PORT                      Server Port Number (default: 5672)
39       -T            --tls                            Toggle TLS (default: False)
40       -c CERTFILE   --cert=CERTFILE                  TLS Client Certificate File
41       -k KEYFILE    --key=KEYFILE                    TLS Client Private Key File
42       -U USERNAME   --user=USERNAME                  Username for Auth
43       -P PASSWORD   --pass=PASSWORD                  Password for Auth
44       -s INT        --heartbeats=INT                 heartbeat interval (0=disable, default: set by server)
45       -n NAME       --name=NAME                      connection name, will be shown in RabbitMQ web interface
46       -w SECONDS    --connect_timeout=SECONDS        timeout for establishing initial connection (default: 600)
47 <!--
48 SPDX-FileCopyrightText: 2022 Frank Doepper
49
50 SPDX-License-Identifier: FSFAP
51 -->
52
53 # EXAMPLES
54
55 provide shell access to a remote user. Very insecure! :-)
56
57     arbeite -o amqp.example.com -T -k amqp.pem -c amqp.pem -y myexchange -Q rpctest -i -Xsh
58
59 <!--
60 SPDX-FileCopyrightText: 2022 Frank Doepper
61
62 SPDX-License-Identifier: FSFAP
63 -->
64 # FILES
65
66 ## callbacks
67
68 `konsum` and `arbeite` can execute programs (`-Xprogram`) on reception of a message.
69
70 ### normal (old) mode
71
72 The callback is called with the following arguments:
73
74     -f filename
75     -n messagenumber
76
77 Optionally are added:
78
79     -r routingkey
80     -m contenttype
81     -e encoding
82     -i messageid
83     -t timestamp
84     -p priority
85     -R redelivered
86
87 Message headers are added through several -h options:
88
89     -h HEADER=VALUE
90
91 Any additional arguments provided by `-a arg` options are appended.
92
93 ### simple (new) mode
94
95 Wenn called with `-i` (`--simple`), the callback is called with only the filename
96 as argument. Any additional arguments provided by `-a arg` options are prepended.
97
98 # ENVIRONMENT
99
100 The arguments provided in normal (old) mode are also available as environment
101 variables in both modes in the callback:
102
103     AMQP_FILE
104     AMQP_NUMBER
105
106     AMQP_ROUTINGKEY
107     AMQP_CONTENTTYPE
108     AMQP_ENCODING
109     AMQP_MSGID
110     AMQP_TIMESTAMP
111     AMQP_PRIORITY
112     AMQP_REDELIVERED
113
114 And the remaining message properties, too:
115
116     AMQP_SIZE
117     AMQP_TYPE
118     AMQP_USERID
119     AMQP_APPID
120     AMQP_CLUSTERID
121     AMQP_REPLYTO
122     AMQP_CORRID
123     AMQP_EXPIRATION
124     AMQP_DELIVERYMODE
125
126 Message headers, if any, are available as
127
128     AMQP_HEADER_KEY_0
129     AMQP_HEADER_VALUE_0
130     AMQP_HEADER_KEY_1
131     AMQP_HEADER_VALUE_1
132
133 etc.
134