10
10
class Application ()
11
11
```
12
12
13
- [[VIEW SOURCE ]](https :// github .com / quixio / quix - streams / blob / 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams / app .py # L59 )
13
+ [[VIEW SOURCE ]](https :// github .com / quixio / quix - streams / blob / e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams / app .py # L54 )
14
14
15
15
The main Application class .
16
16
@@ -58,12 +58,11 @@ app.run(dataframe=df)
58
58
# ### Application.\_\_init\_\_
59
59
60
60
```python
61
- def __init__ (broker_address: Optional[str ] = None ,
61
+ def __init__ (broker_address: Optional[Union[ str , ConnectionConfig] ] = None ,
62
62
quix_sdk_token: Optional[str ] = None ,
63
63
consumer_group: Optional[str ] = None ,
64
64
auto_offset_reset: AutoOffsetReset = " latest" ,
65
65
commit_interval: float = 5.0 ,
66
- partitioner: Partitioner = " murmur2" ,
67
66
consumer_extra_config: Optional[dict ] = None ,
68
67
producer_extra_config: Optional[dict ] = None ,
69
68
state_dir: str = " state" ,
@@ -78,17 +77,21 @@ def __init__(broker_address: Optional[str] = None,
78
77
auto_create_topics: bool = True ,
79
78
use_changelog_topics: bool = True ,
80
79
quix_config_builder: Optional[QuixKafkaConfigsBuilder] = None ,
81
- topic_manager: Optional[TopicManager] = None )
80
+ topic_manager: Optional[TopicManager] = None ,
81
+ request_timeout: float = 30 ,
82
+ topic_create_timeout: float = 60 )
82
83
```
83
84
84
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L97 )
85
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L92 )
85
86
86
87
87
88
< br>
88
89
** * Arguments:***
89
90
90
- - `broker_address` : Kafka broker host and port in format `< host> :< port> ` .
91
- Passed as `bootstrap.servers` to `confluent_kafka.Consumer` .
91
+ - `broker_address` : Connection settings for Kafka.
92
+ Used by Producer, Consumer, and Admin clients.
93
+ Accepts string with Kafka broker host and port formatted as `< host> :< port> ` ,
94
+ or a ConnectionConfig object if authentication is required.
92
95
Either this OR `quix_sdk_token` must be set to use `Application` (not both).
93
96
Linked Environment Variable: `Quix__Broker__Address` .
94
97
Default: `None `
@@ -105,8 +108,6 @@ Default - "quixstreams-default" (set during init)
105
108
- `commit_interval` : How often to commit the processed messages in seconds.
106
109
Default - 5.0 .
107
110
- `auto_offset_reset` : Consumer `auto.offset.reset` setting
108
- - `partitioner` : A function to be used to determine the outgoing message
109
- partition.
110
111
- `consumer_extra_config` : A dictionary with additional options that
111
112
will be passed to `confluent_kafka.Consumer` as is .
112
113
- `producer_extra_config` : A dictionary with additional options that
@@ -130,6 +131,8 @@ Default - `True`
130
131
- `use_changelog_topics` : Use changelog topics to back stateful operations
131
132
Default - `True `
132
133
- `topic_manager` : A `TopicManager` instance
134
+ - `request_timeout` : timeout (seconds) for REST - based requests
135
+ - `topic_create_timeout` : timeout (seconds) for topic create finalization
133
136
< br>< br> *** Error Handlers*** < br>
134
137
To handle errors, `Application` accepts callbacks triggered when
135
138
exceptions occur on different stages of stream processing. If the callback
@@ -157,7 +160,6 @@ instead of the default one.
157
160
def Quix(cls ,
158
161
consumer_group: Optional[str ] = None ,
159
162
auto_offset_reset: AutoOffsetReset = " latest" ,
160
- partitioner: Partitioner = " murmur2" ,
161
163
consumer_extra_config: Optional[dict ] = None ,
162
164
producer_extra_config: Optional[dict ] = None ,
163
165
state_dir: str = " state" ,
@@ -172,10 +174,12 @@ def Quix(cls,
172
174
quix_config_builder: Optional[QuixKafkaConfigsBuilder] = None ,
173
175
auto_create_topics: bool = True ,
174
176
use_changelog_topics: bool = True ,
175
- topic_manager: Optional[QuixTopicManager] = None ) -> Self
177
+ topic_manager: Optional[QuixTopicManager] = None ,
178
+ request_timeout: float = 30 ,
179
+ topic_create_timeout: float = 60 ) -> Self
176
180
```
177
181
178
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L303 )
182
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L305 )
179
183
180
184
> *** NOTE :*** DEPRECATED : use Application with `quix_sdk_token` argument instead.
181
185
@@ -223,8 +227,6 @@ Linked Environment Variable: `Quix__Consumer__Group`.
223
227
Default - " quixstreams-default" (set during init).
224
228
> *** NOTE :*** Quix Applications will prefix it with the Quix workspace id .
225
229
- `auto_offset_reset` : Consumer `auto.offset.reset` setting
226
- - `partitioner` : A function to be used to determine the outgoing message
227
- partition.
228
230
- `consumer_extra_config` : A dictionary with additional options that
229
231
will be passed to `confluent_kafka.Consumer` as is .
230
232
- `producer_extra_config` : A dictionary with additional options that
@@ -248,6 +250,8 @@ Default - `True`
248
250
- `use_changelog_topics` : Use changelog topics to back stateful operations
249
251
Default - `True `
250
252
- `topic_manager` : A `QuixTopicManager` instance
253
+ - `request_timeout` : timeout (seconds) for REST - based requests
254
+ - `topic_create_timeout` : timeout (seconds) for topic create finalization
251
255
< br>< br> *** Error Handlers*** < br>
252
256
To handle errors, `Application` accepts callbacks triggered when
253
257
exceptions occur on different stages of stream processing. If the callback
@@ -285,7 +289,7 @@ def topic(name: str,
285
289
timestamp_extractor: Optional[TimestampExtractor] = None ) -> Topic
286
290
```
287
291
288
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L439 )
292
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L443 )
289
293
290
294
Create a topic definition.
291
295
@@ -366,7 +370,7 @@ topic = app.topic("input-topic", timestamp_extractor=custom_ts_extractor)
366
370
def dataframe(topic: Topic) -> StreamingDataFrame
367
371
```
368
372
369
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L519 )
373
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L523 )
370
374
371
375
A simple helper method that generates a `StreamingDataFrame` , which is used
372
376
@@ -416,7 +420,7 @@ to be used as an input topic.
416
420
def stop(fail: bool = False )
417
421
```
418
422
419
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L558 )
423
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L562 )
420
424
421
425
Stop the internal poll loop and the message processing.
422
426
@@ -443,7 +447,7 @@ to unhandled exception, and it shouldn't commit the current checkpoint.
443
447
def get_producer() -> Producer
444
448
```
445
449
446
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L581 )
450
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L585 )
447
451
448
452
Create and return a pre- configured Producer instance.
449
453
The Producer is initialized with params passed to Application.
@@ -478,7 +482,7 @@ with app.get_producer() as producer:
478
482
def get_consumer(auto_commit_enable: bool = True ) -> Consumer
479
483
```
480
484
481
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L612 )
485
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L615 )
482
486
483
487
Create and return a pre- configured Consumer instance.
484
488
The Consumer is initialized with params passed to Application.
@@ -523,7 +527,7 @@ with app.get_consumer() as consumer:
523
527
def clear_state()
524
528
```
525
529
526
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L656 )
530
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L658 )
527
531
528
532
Clear the state of the application.
529
533
@@ -537,7 +541,7 @@ Clear the state of the application.
537
541
def run(dataframe: StreamingDataFrame)
538
542
```
539
543
540
- [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ 3d3aca1106fe7f136d5005bdfd380dc4118c118b / quixstreams/ app.py# L662 )
544
+ [[VIEW SOURCE ]](https:// github.com/ quixio/ quix- streams/ blob/ e4fe9845a6b3ae9985af686f3d54f5c78074c770 / quixstreams/ app.py# L664 )
541
545
542
546
Start processing data from Kafka using provided `StreamingDataFrame`
543
547
0 commit comments