-
Notifications
You must be signed in to change notification settings - Fork 232
/
uamqp.client.SendClient.yml
434 lines (368 loc) · 13.8 KB
/
uamqp.client.SendClient.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
### YamlMime:PythonClass
uid: uamqp.client.SendClient
name: SendClient
fullName: uamqp.client.SendClient
module: uamqp.client
inheritances:
- uamqp.client.AMQPClient
summary: An AMQP client for sending messages.
constructor:
syntax: SendClient(target, auth=None, client_name=None, debug=False, msg_timeout=0,
error_policy=None, keep_alive_interval=None, **kwargs)
parameters:
- name: target
description: 'The target AMQP service endpoint. This can either be the URI as
a string or a ~uamqp.address.Target object.'
isRequired: true
types:
- <xref:str>, <xref:bytes>
- <xref:uamqp.address.Target>
- name: auth
description: "Authentication for the connection. This should be one of the subclasses\
\ of\nuamqp.authentication.AMQPAuth. Currently this includes:\n\n * uamqp.authentication.SASLAnonymous\
\ \n\n * uamqp.authentication.SASLPlain \n\n * uamqp.authentication.SASTokenAuth\
\ \n\n * uamqp.authentication.JWTTokenAuth \n\nIf no authentication is supplied,\
\ SASLAnnoymous will be used by default."
defaultValue: None
types:
- <xref:uamqp.authentication.common.AMQPAuth>
- name: client_name
description: 'The name for the client, also known as the Container ID.
If no name is provided, a random GUID will be used.'
defaultValue: None
types:
- <xref:str>
- <xref:bytes>
- name: debug
description: 'Whether to turn on network trace logs. If *True*, trace logs
will be logged at INFO level. Default is *False*.'
defaultValue: 'False'
types:
- <xref:bool>
- name: msg_timeout
description: 'A timeout in milliseconds for messages from when they have been
added to the send queue to when the message is actually sent. This prevents
potentially
expired data from being sent. If set to 0, messages will not expire. Default
is 0.'
defaultValue: '0'
types:
- <xref:int>
- name: error_policy
description: 'A policy for parsing errors on link, connection and message
disposition to determine whether the error should be retryable.'
defaultValue: None
types:
- <xref:uamqp.errors.ErrorPolicy>
- name: keep_alive_interval
description: 'If set, a thread will be started to keep the connection
alive during periods of user inactivity. The value will determine how long the
thread will sleep (in seconds) between pinging the connection. If 0 or None,
no
thread will be started.'
defaultValue: None
types:
- <xref:int>
- name: send_settle_mode
description: 'The mode by which to settle message send
operations. If set to *Unsettled*, the client will wait for a confirmation
from the service that the message was successfully sent. If set to ''Settled'',
the client will not wait for confirmation and assume success.'
isRequired: true
types:
- <xref:uamqp.constants.SenderSettleMode>
- name: receive_settle_mode
description: 'The mode by which to settle message receive
operations. If set to *PeekLock*, the receiver will lock a message once received
until
the client accepts or rejects the message. If set to *ReceiveAndDelete*, the
service
will assume successful receipt of the message and clear it from the queue. The
default is *PeekLock*.'
isRequired: true
types:
- <xref:uamqp.constants.ReceiverSettleMode>
- name: desired_capabilities
description: "The extension capabilities desired from the peer endpoint.\nTo create\
\ a desired_capabilities object, please do as follows:\n\n * 1. Create an\
\ array of desired capability symbols: *capabilities_symbol_array = [types.AMQPSymbol(string)]*\
\ \n\n\n * 2. Transform the array to AMQPValue object: *utils.data_factory(types.AMQPArray(capabilities_symbol_array))*"
isRequired: true
types:
- <xref:uamqp.c_uamqp.AMQPValue>
- name: max_message_size
description: The maximum allowed message size negotiated for the Link.
isRequired: true
types:
- <xref:int>
- name: link_properties
description: Metadata to be sent in the Link ATTACH frame.
isRequired: true
types:
- <xref:dict>
- name: link_credit
description: 'The sender Link credit that determines how many
messages the Link will attempt to handle per connection iteration.'
isRequired: true
types:
- <xref:int>
- name: max_frame_size
description: Maximum AMQP frame size. Default is 63488 bytes.
isRequired: true
types:
- <xref:int>
- name: channel_max
description: Maximum number of Session channels in the Connection.
isRequired: true
types:
- <xref:int>
- name: idle_timeout
description: 'Timeout in milliseconds after which the Connection will close
if there is no further activity.'
isRequired: true
types:
- <xref:int>
- name: properties
description: Connection properties.
isRequired: true
types:
- <xref:dict>
- name: remote_idle_timeout_empty_frame_send_ratio
description: 'Ratio of empty frames to
idle time for Connections with no activity. Value must be between
0.0 and 1.0 inclusive. Default is 0.5.'
isRequired: true
types:
- <xref:float>
- name: incoming_window
description: The size of the allowed window for incoming messages.
isRequired: true
types:
- <xref:int>
- name: outgoing_window
description: The size of the allowed window for outgoing messages.
isRequired: true
types:
- <xref:int>
- name: handle_max
description: The maximum number of concurrent link handles.
isRequired: true
types:
- <xref:int>
- name: on_attach
description: 'A callback function to be run on receipt of an ATTACH frame.
The function must take 4 arguments: source, target, properties and error.'
isRequired: true
types:
- <xref:func>[<xref:uamqp.address.Source>, <xref:uamqp.address.Target>, <xref:dict>,
<xref:uamqp.errors.AMQPConnectionError>]
- name: encoding
description: 'The encoding to use for parameters supplied as strings.
Default is ''UTF-8'''
isRequired: true
types:
- <xref:str>
methods:
- uid: uamqp.client.SendClient.auth_complete
name: auth_complete
summary: 'Whether the authentication handshake is complete during
connection initialization.'
signature: auth_complete()
return:
types:
- <xref:bool>
- uid: uamqp.client.SendClient.client_ready
name: client_ready
summary: 'Whether the handler has completed all start up processes such as
establishing the connection, session, link and authentication, and
is not ready to process messages.'
signature: client_ready()
return:
types:
- <xref:bool>
- uid: uamqp.client.SendClient.close
name: close
summary: 'Close the client. This includes closing the Session
and CBS authentication layer as well as the Connection.
If the client was opened using an external Connection,
this will be left intact.
No further messages can be sent or received and the client
cannot be re-opened.
All pending, unsent messages will remain uncleared to allow
them to be inspected and queued to a new client.'
signature: close()
- uid: uamqp.client.SendClient.do_work
name: do_work
summary: 'Run a single connection iteration.
This will return *True* if the connection is still open
and ready to be used for further work, or *False* if it needs
to be shut down.'
signature: do_work(**kwargs)
return:
types:
- <xref:bool>
exceptions:
- type: TimeoutError or uamqp.errors.ClientTimeout if CBS authentication timeout
reached.
- uid: uamqp.client.SendClient.messages_pending
name: messages_pending
summary: 'Check whether the client is holding any unsent
messages in the queue.'
signature: messages_pending()
return:
types:
- <xref:bool>
- uid: uamqp.client.SendClient.mgmt_request
name: mgmt_request
summary: 'Run a request/response operation. These are frequently used for management
tasks against a $management node, however any node name can be specified
and the available options will depend on the target service.'
signature: mgmt_request(message, operation, op_type=None, node=None, callback=None,
**kwargs)
parameters:
- name: message
description: The message to send in the management request.
isRequired: true
types:
- <xref:uamqp.message.Message>
- name: operation
description: 'The type of operation to be performed. This value will
be service-specific, but common values include READ, CREATE and UPDATE.
This value will be added as an application property on the message.'
isRequired: true
types:
- <xref:bytes>
- name: op_type
description: 'The type on which to carry out the operation. This will
be specific to the entities of the service. This value will be added as
an application property on the message.'
defaultValue: None
types:
- <xref:bytes>
- name: node
description: The target node. Default is *b"$management"*.
defaultValue: None
types:
- <xref:bytes>
- name: timeout
description: 'Provide an optional timeout in milliseconds within which a response
to the management request must be received.'
isRequired: true
types:
- <xref:float>
- name: callback
description: 'The function to process the returned parameters of the management
request including status code and a description if available. This can be used
to reformat the response or raise an error based on content. The function must
take 3 arguments - status code, response message and description.'
defaultValue: None
types:
- <xref:callable>[<xref:int>, <xref:bytes>, <xref:uamqp.message.Message>]
- name: status_code_field
description: 'Provide an alternate name for the status code in the
response body which can vary between services due to the spec still being in
draft.
The default is *b"statusCode"*.'
isRequired: true
types:
- <xref:bytes>
- name: description_fields
description: 'Provide an alternate name for the description in the
response body which can vary between services due to the spec still being in
draft.
The default is *b"statusDescription"*.'
isRequired: true
types:
- <xref:bytes>
return:
types:
- <xref:uamqp.message.Message>
- uid: uamqp.client.SendClient.open
name: open
summary: 'Open the client. The client can create a new Connection
or an existing Connection can be passed in. This existing Connection
may have an existing CBS authentication Session, which will be
used for this client as well. Otherwise a new Session will be
created.'
signature: open(connection=None)
parameters:
- name: connection
description: 'An existing Connection that may be shared between
multiple clients.'
defaultValue: None
- uid: uamqp.client.SendClient.queue_message
name: queue_message
summary: "Add one or more messages to the send queue.\nNo further action will be\
\ taken until either *SendClient.wait()*\nor *SendClient.send_all_messages()*\
\ has been called.\nThe client does not need to be open yet for messages to be\
\ added\nto the queue. Multiple messages can be queued at once:\n\n * *send_client.queue_message(my_message)*\
\ \n\n * *send_client.queue_message(message_1, message_2, message_3)* \n\n \
\ * *send_client.queue_message(*my_message_list)*"
signature: queue_message(*messages)
parameters:
- name: messages
description: 'A message to send. This can either be a single instance
of *Message*, or multiple messages wrapped in an instance of *BatchMessage*.'
isRequired: true
- uid: uamqp.client.SendClient.redirect
name: redirect
summary: 'Redirect the client endpoint using a Link DETACH redirect
response.'
signature: redirect(redirect, auth)
parameters:
- name: redirect
description: The Link DETACH redirect details.
isRequired: true
types:
- <xref:uamqp.errors.LinkRedirect>
- name: auth
description: Authentication credentials to the redirected endpoint.
isRequired: true
types:
- <xref:uamqp.authentication.common.AMQPAuth>
- uid: uamqp.client.SendClient.send_all_messages
name: send_all_messages
summary: 'Send all pending messages in the queue. This will return a list
of the send result of all the pending messages so it can be
determined if any messages failed to send.
This function will open the client if it is not already open.'
signature: send_all_messages(close_on_done=True)
parameters:
- name: close_on_done
description: 'Close the client once the messages are sent.
Default is *True*.'
defaultValue: 'True'
types:
- <xref:bool>
return:
types:
- <xref:list>[<xref:uamqp.constants.MessageState>]
- uid: uamqp.client.SendClient.send_message
name: send_message
summary: Send a single message or batched message.
signature: send_message(messages, close_on_done=False)
parameters:
- name: messages
description: 'A message to send. This can either be a single instance
of *Message*, or multiple messages wrapped in an instance of *BatchMessage*.'
isRequired: true
- name: close_on_done
description: Close the client once the message is sent. Default is *False*.
defaultValue: 'False'
types:
- <xref:bool>
exceptions:
- type: uamqp.errors.MessageException if message fails to send after retry policyis
exhausted.
- uid: uamqp.client.SendClient.wait
name: wait
summary: 'Run the client until all pending message in the queue
have been processed. Returns whether the client is still running after the
messages have been processed, or whether a shutdown has been initiated.'
signature: wait()
return:
types:
- <xref:bool>
attributes:
- uid: uamqp.client.SendClient.pending_messages
name: pending_messages