You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/12/30 03:46:15 UTC

[GitHub] [apisix] tokers commented on a diff in pull request #8583: feat: stream subsystem support eureka service discovery

tokers commented on code in PR #8583:
URL: https://github.com/apache/apisix/pull/8583#discussion_r1059230391


##########
docs/en/latest/discovery.md:
##########
@@ -243,6 +245,35 @@ Suppose both A-SERVICE and B-SERVICE provide a `/test` API. The above configurat
 
 **Notice**:When configuring `upstream.service_name`,  `upstream.nodes` will no longer take effect, but will be replaced by 'nodes' obtained from the registry.
 
+### stream_routes
+
+Eureka service discovery also supports use in `stream_routes`, the configuration method is similar to `routes`.
+
+```shell
+$ curl http://127.0.0.1:9180/apisix/admin/stream_routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
+{
+    "remote_addr": "127.0.0.1",
+    "upstream": {
+        "discovery_type": "eureka",
+        "service_name": "APISIX-EUREKA",
+        "type": "roundrobin"
+    }
+}'
+HTTP/1.1 200 OK
+Date: Fri, 30 Dec 2022 03:06:50 GMT
+Content-Type: application/json
+Transfer-Encoding: chunked
+Connection: keep-alive
+Server: APISIX/3.0.0
+Access-Control-Allow-Origin: *
+Access-Control-Allow-Credentials: true
+Access-Control-Expose-Headers: *
+Access-Control-Max-Age: 3600
+X-API-VERSION: v3
+
+{"key":"\/apisix\/stream_routes\/1","value":{"update_time":1672369610,"id":"1","remote_addr":"127.0.0.1","create_time":1672106762,"upstream":{"discovery_type":"eureka","service_name":"APISIX-EUREKA","pass_host":"pass","scheme":"http","type":"roundrobin","hash_on":"vars"}}}

Review Comment:
   I think this example is not so good because in the stream proxy, why we will have an upstream which schema is `http`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org