Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable streaming via web #1961

Open
asim opened this issue Aug 17, 2022 · 1 comment
Open

Enable streaming via web #1961

asim opened this issue Aug 17, 2022 · 1 comment

Comments

@asim
Copy link
Member

asim commented Aug 17, 2022

Streaming endpoints do not work in the web UI. Would be useful to make it possible to stream back websocket response for streaming endpoints. Requires UI to know the endpoint is a streaming endpoints, establish a websocket connection and stream back the response.

@alex-dna-tech
Copy link
Contributor

Stream request stops getting parameters in CLI. helloworld req.Name example:

dna-tech@alex:~$ docker run -it --rm micro/micro server
2024-04-16 03:59:41  file=user/user.go:99 level=info Setting up keys for JWT at /root/.micro/id_rsa and /root/.micro/id_rsa.pub
2024-04-16 03:59:44  file=server/server.go:74 level=info Starting server
2024-04-16 03:59:44  file=server/server.go:129 level=info Registering registry
2024-04-16 03:59:44  file=server/server.go:129 level=info Registering broker
2024-04-16 03:59:44  file=server/server.go:129 level=info Registering network
2024-04-16 03:59:44  file=server/server.go:129 level=info Registering runtime
2024-04-16 03:59:44  file=server/server.go:129 level=info Registering config
2024-04-16 03:59:44  file=server/server.go:129 level=info Registering store
2024-04-16 03:59:44  file=server/server.go:129 level=info Registering events
2024-04-16 03:59:44  file=server/server.go:129 level=info Registering auth
2024-04-16 03:59:44  file=server/server.go:139 level=info Starting runtime
2024-04-16 03:59:44  file=grpc/grpc.go:992 level=info Server [grpc] Listening on [::]:8081
2024-04-16 03:59:44  file=http/http.go:93 level=info HTTP Server Listening on [::]:8080
---
dna-tech@alex:~$ docker ps
CONTAINER ID   IMAGE                            COMMAND                  CREATED          STATUS                    PORTS                             NAMES
ab90b751f6e0   micro/micro                      "/micro server"          50 seconds ago   Up 49 seconds                                               compassionate_tu
dna-tech@alex:~$ docker exec -it ab90b751f6e0 sh
/ # ./micro login
Enter username: admin
Enter password:
Successfully logged in.
/ # ./micro run github.com/micro/services/helloworld
/ # /micro status helloworld
NAME            VERSION SOURCE                                  STATUS  BUILD   UPDATEDMETADATA
helloworld      latest  github.com/micro/services/helloworld    running n/a     1m40s ago       owner=admin, group=micro
/ # /micro services
auth
broker
config
events
helloworld
network
registry
runtime
store
/ # /micro helloworld stream --help
NAME:
        micro helloworld stream

USAGE:
        micro helloworld stream [flags]

FLAGS:

/ # /micro helloworld stream --name="John" --messages=10
Unknown flag: name
/ #
/ # /micro helloworld call --help
NAME:
        micro helloworld call

USAGE:
        micro helloworld call [flags]

FLAGS:
        --name string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants