File tree Expand file tree Collapse file tree 1 file changed +21
-16
lines changed
Expand file tree Collapse file tree 1 file changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,20 @@ send data to kafka: GET /hello
149149 },
150150 "type": "roundrobin"
151151 },
152+ "uri": "/hello"
153+ }]]
154+ )
155+ ngx.sleep(0.5)
156+
157+ if code >= 300 then
158+ ngx.status = code
159+ ngx.say("fail")
160+ return
161+ end
162+
163+ code, body = t('/apisix/admin/global_rules/1',
164+ ngx.HTTP_PUT,
165+ [[{
152166 "plugins": {
153167 "kafka-logger": {
154168 "broker_list" : {
@@ -160,8 +174,7 @@ send data to kafka: GET /hello
160174 "include_req_body": false,
161175 "cluster_name": 1
162176 }
163- },
164- "uri": "/hello"
177+ }
165178 }]]
166179 )
167180
@@ -171,15 +184,12 @@ send data to kafka: GET /hello
171184 return
172185 end
173186
174- local code, body = t('/apisix/admin/routes/2',
175- ngx.HTTP_PUT,
187+ t('/hello',ngx.HTTP_GET)
188+ ngx.sleep(0.5)
189+
190+ code, body = t('/apisix/admin/global_rules/1',
191+ ngx.HTTP_PUT,
176192 [[{
177- "upstream": {
178- "nodes": {
179- "127.0.0.1:1980": 1
180- },
181- "type": "roundrobin"
182- },
183193 "plugins": {
184194 "kafka-logger": {
185195 "broker_list" : {
@@ -191,11 +201,9 @@ send data to kafka: GET /hello
191201 "include_req_body": false,
192202 "cluster_name": 2
193203 }
194- },
195- "uri": "/hello2"
204+ }
196205 }]]
197206 )
198- ngx.sleep(0.5)
199207
200208 if code >= 300 then
201209 ngx.status = code
@@ -206,9 +214,6 @@ send data to kafka: GET /hello
206214 t('/hello',ngx.HTTP_GET)
207215 ngx.sleep(0.5)
208216
209- t('/hello2',ngx.HTTP_GET)
210- ngx.sleep(0.5)
211-
212217 ngx.sleep(2)
213218 ngx.say("passed")
214219 }
You can’t perform that action at this time.
0 commit comments