https://github.com/el-zacharoo/pubsub
https://github.com/el-zacharoo/pubsub
golang grpc protobuf pubsub
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/el-zacharoo/pubsub
- Owner: el-zacharoo
- Created: 2022-05-20T03:03:21.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-17T02:21:09.000Z (almost 4 years ago)
- Last Synced: 2024-12-16T17:01:13.819Z (over 1 year ago)
- Topics: golang, grpc, protobuf, pubsub
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# publisher
This service is apart of my `pub-sub` services, which connects to my other app, the `subscriber` service.
Pub/Sub allows services to communicate asynchronously, with latencies on the order of 100 milliseconds.
When I push data from this service, my subscriber recieves the data, puts in in mongoDB and returns a message.
## Get started
- Install/update dependencies `go get -u`
- Run `make proto`, this will also send the proto definitions to `https://buf.build` as a commit.
- Run the application: `make run`, this will run on port 8081
- Make sure the subscriber service is also running, this should be visibil on port 8082
### Dapr ###
Install and configure the dapr CLI:
```bash
brew install dapr/tap/dapr-cli
dapr init
```
### Buf ###
Add Buf API key to `.netrc` file
```bash
machine buf.build password
machine go.buf.build login password
```
## Postman Setup ##
- Go to New, select gRPC Request
- Call `localhost:8080`
- Select the proto definitions file to put into the methods input
- Make sure server reflection is enabled in methods
- You can generate example JSON Messages (this is particularly useful when using the CREATE method, make sure the ID field isn't present as this is being filled in automatically when an entry is created)