@@ -26,20 +26,32 @@ Here is how to connect to the Quix Cloud Kafka brokers using Quix Streams:
26
26
27
27
If you are running your Quix Streams ` Application ` directly within Quix Cloud, it's configured automatically.
28
28
29
+ Just make sure ` broker_address ` is NOT set:
30
+
31
+ ``` python
32
+ from quixstreams import Application
33
+
34
+ app = Application()
35
+ ```
36
+ OR
37
+ ``` python
38
+ from quixstreams import Application
39
+
40
+ app = Application(broker_address = None )
41
+ ```
42
+
29
43
### Outside of Quix Cloud
30
44
31
45
32
- #### 1. Obtain Streaming Token
33
- First, [ get your Streaming
34
- Token] ( https://quix.io/docs/develop/authentication/streaming-token.html#how-to-find ) (also
35
- called ` SDK Token ` ).
46
+ #### 1. Obtain SDK Token
47
+ First, [ get your SDK Token] ( https://quix.io/docs/develop/authentication/streaming-token.html#how-to-find ) .
36
48
37
49
> NOTE: A ` Personal Access Token ` (PAT) is also accepted, but often requires more configuration
38
50
> due to raised privileges. We recommend using the ` SDK Token ` .
39
51
40
52
<br >
41
53
42
- #### 2. Pass Streaming Token to Application
54
+ #### 2. Pass SDK Token to Application
43
55
With your ` SDK Token ` and a Quix Streams ` Application ` , you can pass it using one of
44
56
these approaches:
45
57
@@ -50,7 +62,12 @@ these approaches:
50
62
OR <br >
51
63
52
64
- ** Application argument**
53
- - Just do ` Application(quix_sdk_token="MY_TOKEN") `
65
+ - Just do:
66
+ ``` python
67
+ from quixstreams import Application
68
+
69
+ app = Application(quix_sdk_token = " MY_TOKEN" )
70
+ ```
54
71
> WARNING : This value is prioritized over `Quix__Sdk__Token` , which may cause ambiguity if both are set .
55
72
56
73
< br>
@@ -59,4 +76,20 @@ OR <br>
59
76
When you initialize your `Application()` , a message should be logged letting
60
77
you know it will connect to Quix Cloud when `Application.run()` is called.
61
78
62
- If not, you'll need to double check your settings and try again!
79
+ If not , you' ll need to double check your settings and try again!
80
+
81
+ # # Local Development to Quix Cloud
82
+
83
+ For those wanting to [develop with a local broker](tutorials/ README .md# running-kafka-locally)
84
+ and then migrate to Quix Cloud, here is a recommended example pattern that avoids code changes:
85
+
86
+ ```python
87
+ from quixstreams import Application
88
+ import os
89
+
90
+ app = Application(broker_address = os.getenv(" YOUR_ENV_VAR" , None ))
91
+ ```
92
+
93
+ Just pick an environment variable and set it to your local broker address!
94
+
95
+ In Quix Cloud it will default to `None ` as desired and use the Quix Cloud environment.
0 commit comments